Remote IP
Remote IP
Good Morning Everyone,
IT's been a long time, isn't !
Ok here is a my question, is it possible to know the Remote client IP adress when the connection goes through a ROUTER. I know that the complete ROUTE is in the TCP/IP packet. Can someone point me to the right direction,
Thank you,
Best Regards,
IT's been a long time, isn't !
Ok here is a my question, is it possible to know the Remote client IP adress when the connection goes through a ROUTER. I know that the complete ROUTE is in the TCP/IP packet. Can someone point me to the right direction,
Thank you,
Best Regards,
Sylvain Robert
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Remote IP
Hi, Sylvain! Glad to see you here again!
Unfortunately I can't help you with your problem.
EMG
Unfortunately I can't help you with your problem.
EMG
Re: Remote IP
Hi Enrico,
Nice to read you my friend !
I already found a solution with IPV6 and Teredo protocol, I'll give a try to the SNMP protocol, it will be mor generic !
HTH,
Sylvain
Nice to read you my friend !
I already found a solution with IPV6 and Teredo protocol, I'll give a try to the SNMP protocol, it will be mor generic !
HTH,
Sylvain
Sylvain Robert
- AlexSchaft
- Posts: 172
- Joined: Fri Oct 07, 2005 1:29 pm
- Location: Edenvale, Gauteng, South Africa
Remote IP
Hi Sylvain,
Are you looking for the ip address of the client connecting to a server socket?
If so, you need oSocket:ClientIP()
Are you looking for the ip address of the client connecting to a server socket?
If so, you need oSocket:ClientIP()
Code: Select all
nEchoPort := ::nPortNo+::nPortNo / 100
Do While .t.
::oEchoSocket := tsocket():New(nEchoPort)
If ::oEchoSocket:lStartOK
Exit
Else
nEchoPort++
Endif
Enddo
::oEchoSocket:bAccept := {| oSocket | ::EchoAccept(oSocket:nSocket)}
If !::oEchoSocket:Listen()
::Error("Monitor Listening socket error " + NTRIM(wsagetlasterror()))
Endif
return nil
METHOD Echoaccept(pnSocket) CLASS qReceive
Local oSocket := nil
oSocket := tsocket():Accept(pnSocket)
oSocket:bRead := {| poSocket |::EchoRead(poSocket)}
oSocket:bWrite := {| poSocket |::EchoWrite(poSocket)}
oSocket:bClose := {| poSocket |::EchoClose(poSocket)}
::Error("Listener joined from "+oSocket:Clientip(), False)
aadd(::aaEchoSocket, {oSocket, 0, ,""}) // For flags and data
oSocket:SendData("Welcome listener from "+oSocket:Clientip()+CRLF)
Return nil
Alex,
Can I create on a fwh program a listbox where i can insert all Pc link to my server ?
I explain you
i have on a classroom a pc and another 24 pc link to this pc
I want see how many pc is open or not
In Vb this is possibile .. but in fwh I not Know How make it
thanks
Can I create on a fwh program a listbox where i can insert all Pc link to my server ?
I explain you
i have on a classroom a pc and another 24 pc link to this pc
I want see how many pc is open or not
In Vb this is possibile .. but in fwh I not Know How make it
thanks
Best Regards, Saludos
Falconi Silvio
Falconi Silvio
- AlexSchaft
- Posts: 172
- Joined: Fri Oct 07, 2005 1:29 pm
- Location: Edenvale, Gauteng, South Africa
Connecting
Yes,
The main pc runs the listen socket, and all the others connect to it on startup.
Increment a counter when they connect, and decrement when they disconnect
The main pc runs the listen socket, and all the others connect to it on startup.
Increment a counter when they connect, and decrement when they disconnect
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Patrick Mast
- Posts: 244
- Joined: Sat Mar 03, 2007 8:42 pm
Re: Remote IP
Hey Mate!SylRob wrote:Good Morning Everyone,
IT's been a long time, isn't !
Ok here is a my question, is it possible to know the Remote client IP adress when the connection goes through a ROUTER. I know that the complete ROUTE is in the TCP/IP packet. Can someone point me to the right direction,
Thank you,
Best Regards,
Glad to see you here!
I use my Bekz.net server to receive the user's IP address. I have a small web site that just printts the user's IP address. Works all the time
Patrick
- Patrick Mast
- Posts: 244
- Joined: Sat Mar 03, 2007 8:42 pm
Re: Remote IP
You can also use http://whatismyipaddress.com/ or similar.Patrick Mast wrote:Hey Mate!SylRob wrote:Good Morning Everyone,
IT's been a long time, isn't !
Ok here is a my question, is it possible to know the Remote client IP adress when the connection goes through a ROUTER. I know that the complete ROUTE is in the TCP/IP packet. Can someone point me to the right direction,
Thank you,
Best Regards,
Glad to see you here!
I use my Bekz.net server to receive the user's IP address. I have a small web site that just printts the user's IP address. Works all the time
Patrick
Just read the HTML in a variable en take out the IP address.
Patrick
Hello Patrick,
This won't work either, I'm not using HTTP protocol so I can't read session variable and second it's not my ROUTER IP that I need and I can't run code on the client side because any other software can connect to my TCP server (with the right protocol)
I wrote a TCP server that receive a client connection from Internet and the connection go through the ROUTER to reach my TCP server, so that's why I received the ROUTER IP in ALL languages that I tested !
The only way to get the REAL client IP address is to use IPv6 TEREDO protocol or implement the STUN protocol (server outside the ROUTER who relay the connection to the REAL server), other thing I'll expirement at the moment I have time is to get the ROUTER table with SMNP and write a trace route routine to the final HOP to get the real IP address even if the client his behind a router at the other side !
Best Regards,
It was a real pleasure tu read you Patrick !
Sylvain
This won't work either, I'm not using HTTP protocol so I can't read session variable and second it's not my ROUTER IP that I need and I can't run code on the client side because any other software can connect to my TCP server (with the right protocol)
I wrote a TCP server that receive a client connection from Internet and the connection go through the ROUTER to reach my TCP server, so that's why I received the ROUTER IP in ALL languages that I tested !
The only way to get the REAL client IP address is to use IPv6 TEREDO protocol or implement the STUN protocol (server outside the ROUTER who relay the connection to the REAL server), other thing I'll expirement at the moment I have time is to get the ROUTER table with SMNP and write a trace route routine to the final HOP to get the real IP address even if the client his behind a router at the other side !
Best Regards,
It was a real pleasure tu read you Patrick !
Sylvain
Sylvain Robert