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

J

jchliustuff

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
 
S

Sam

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)

iD8DBQBHo583x9p3GYHlUOIRAuuCAJ9AgiN5gkIopE8zLFE95MWDXKx5VwCfWfmI
KlGTkgxxWHrUQO0TmtfHdzc=
=Kw6h
-----END PGP SIGNATURE-----
 
C

Christopher

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top