Remote IP

Postby AlexSchaft » Thu Feb 07, 2008 9:03 am

SylRob wrote:Alex,

I'm really familiar with the socket function ! :). This won't work if the client connection come from the internet over a Router you'll obtain the ROUTER IP !

Best Regards,

Sylvain


I have used sockets over routers before, and have never had an issue with only getting the router ip....

Below over vpn

Code: Select all  Expand view
D:\Dev>ipconfig

Windows IP Configuration

PPP adapter AST:

        Connection-specific DNS Suffix  . :
        IP Address. . . . . . . . . . . . : 172.21.129.146
        Subnet Mask . . . . . . . . . . . : 255.255.255.255
        Default Gateway . . . . . . . . . :

D:\Dev>tracert -d 172.21.141.190

Tracing route to 172.21.141.190 over a maximum of 30 hops

  1   394 ms   307 ms   373 ms  172.21.129.128
  2     *      276 ms   544 ms  172.21.128.2
  3   687 ms   841 ms   467 ms  172.21.135.6
  4   588 ms   294 ms   752 ms  172.21.141.190

Trace complete.

D:\Dev>telnet 172.21.141.190 4040

Welcome listener from 172.21.129.146
User avatar
AlexSchaft
 
Posts: 172
Joined: Fri Oct 07, 2005 1:29 pm
Location: Edenvale, Gauteng, South Africa

Postby SylRob » Wed Feb 13, 2008 10:46 am

Alex,

The problem wasn't getting my OWN IP, the problem is getting the IP from a client connected to a TCP/IP server that I wrote when the server is behind a ROUTER !

Best Regards,

Sylvain
Sylvain Robert
SylRob
 
Posts: 15
Joined: Thu Nov 01, 2007 4:54 pm

IP

Postby AlexSchaft » Wed Feb 13, 2008 10:51 am

So you want to get the IP Address from Client A, connected to server B, while you are at client C, connecting to B?

Can't server B keep a record of who's connected?
User avatar
AlexSchaft
 
Posts: 172
Joined: Fri Oct 07, 2005 1:29 pm
Location: Edenvale, Gauteng, South Africa

Postby SylRob » Wed Feb 13, 2008 11:19 am

simpler than that, I just want the IP adress of the client that his connected to the current socket descriptor of my TCP/IP server when behind a ROUTER.

Best,

Sylvain
Sylvain Robert
SylRob
 
Posts: 15
Joined: Thu Nov 01, 2007 4:54 pm

Postby AlexSchaft » Wed Feb 13, 2008 1:12 pm

Well, isn't that what oSocket:clientip() gives on the server? It does for me...
User avatar
AlexSchaft
 
Posts: 172
Joined: Fri Oct 07, 2005 1:29 pm
Location: Edenvale, Gauteng, South Africa

Postby SylRob » Wed Feb 13, 2008 1:15 pm

Alex,

It won't if your server is behind the ROUTER and the client connect to your server from the WAN you'll receive the ROUTER IP not the client IP

Best,

Sylvain
Sylvain Robert
SylRob
 
Posts: 15
Joined: Thu Nov 01, 2007 4:54 pm

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 39 guests