473,396 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to get IP address will be used by HTTP in C++

How to get IP address will be used by HTTP in C++

At the client side, when my client machine talks to server, the server
will see the IP address of my machine as part of HTTP request. My
question is how I can programmatically get this IP address which will
be used in HTTP request? I could use gethostname to get IP addresses,
but that is a list. How can I tell which one will be used?

Thanks very much in advance.

Leo
Feb 1 '08 #1
3 3257
Sam
jc*********@yahoo.com writes:
How to get IP address will be used by HTTP in C++
There's no such thing as "HTTP" in C++.
At the client side, when my client machine talks to server, the server
will see the IP address of my machine as part of HTTP request. My
question is how I can programmatically get this IP address which will
be used in HTTP request? I could use gethostname to get IP addresses,
but that is a list. How can I tell which one will be used?
That depends on your specific platform. Try a newsgroup that's appropriate
for your operating system, that's oriented towards development topics. This
has nothing to do with C++. You can also implement HTTP in Python and Perl,
for example, and the same question applies.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQBHo583x9p3GYHlUOIRAuuCAJ9AgiN5gkIopE8zLFE95M WDXKx5VwCfWfmI
KlGTkgxxWHrUQO0TmtfHdzc=
=Kw6h
-----END PGP SIGNATURE-----

Feb 1 '08 #2
Thanks for your tip.

Leo
Feb 1 '08 #3
On Feb 1, 4:22 pm, jchliust...@yahoo.com wrote:
How to get IP address will be used by HTTP in C++

At the client side, when my client machine talks to server, the server
will see the IP address of my machine as part of HTTP request. My
question is how I can programmatically get this IP address which will
be used in HTTP request? I could use gethostname to get IP addresses,
but that is a list. How can I tell which one will be used?

Thanks very much in advance.

Leo
alt.winsock and alt.winsock programming are probably the more
frequented groups to consult for such things, although traffic isn't
what I'd like it to be.
Feb 2 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Phil Amey | last post by:
In a web based form I am able to make sure that there is text in an input field but I want to force the user into inputting a valid email address, one that has @ in the address How can I modify...
117
by: Steevo | last post by:
Any suggestions as to the best programs for cloaking email addresses? Many thanks -- Steevo
7
by: Privacy Advocate | last post by:
//crossposted to: comp.lang.javascript, alt.comp.lang.javascript in an effort to get factual answers from JavaScript experts// Simply put; Is it possible to obtain the real (actual) IP address of...
3
by: Mr. Smith | last post by:
Hi All. I need to be able to determine the IP address a drive letter is mapped to. When a user selects a file from a file open dialog, They will, as usual, navigate to the file they want via;...
7
by: econobeing | last post by:
a guy in my class made a program in VB6 where he could use the internet because he used the IP address of a site instead of the DNS address. i want to make my own browser now that can do that,...
3
by: Wm. Scott Miller | last post by:
Hello all: I'd like some advice on the best way to validate and confirm an e-mail address entered during a registration process. What we are thinking of is something like the following: 1. ...
9
by: chadlupkes | last post by:
I have this code from someone else, and I'm trying to make heads or tails of it because IE doesn't like it. Can anyone help? Or does anyone have a better idea? /* parse the email to check for...
11
by: !truth | last post by:
Hi, i feel confused about the following program, and it's works to get a pointer-member's address. #define NETDEV_ALIGN 32 #define NETDEV_ALIGN_CONST (NETDEV_ALIGN - 1) ...
2
by: Richard Maher | last post by:
Hi, Can someone please tell me the strategy(ies) used by Java (the Security Manager or whatever) to determine if a given IP address conforms to the definition of the codebase from which an...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.