Skip to main content
gamedev.net
🔒 Locked

IP address

Started by H0bbes Nov 15, 2004 at 9:10 AM 4 replies 1.1k views
Original Post
H0bbes
H0bbes
I like to know if i can get IP address from Machine that is connected with Proxy?
doynax
doynax
Quote:
Original post by H0bbes
I like to know if i can get IP address from Machine that is connected with Proxy?
In general you'll have to ask someone with a public IP. This service for example.
Evil Steve
Evil Steve
Just to expand on doynax's answer, you'd need to open a socket to www.whatismyip.com on port 80, and send:
GET / HTTP/1.0Host: www.whatismyip.comConnection: Close

Where each line ends with a "\r\n" pair, and the whole thing ends with a blank line (so the last 4 chars are "\r\n\r\n")
Then read the input until you get "Your ip is ", and then read the next part for the IP.<br/>You could also use a library to make this stuff easier, I believe hplusplus has a very small bit of code to do this. Have a look in the Multiplayer and Network Programming forum.<br/>
C-Junkie
C-Junkie
Quote:
Original post by H0bbes
I like to know if i can get IP address from Machine that is connected with Proxy?
Obviously confusingly worded.

Answer: no. Not unless they tell you. Some proxies will send headers that look like

X-Proxy-For: xxx.xxx.xxx.xxx

or something, but these are rare. really rare. nonexistant rare.
doynax
doynax
Quote:
Original post by Anonymous Poster
Wouldn't this give the IP address of the proxy server?

Yes, I thought that was what you wanted.
So do you want to know the internal address of a machine behind a proxy from the outside? Or perhaps something else entirely..

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.