Page 1 of 1

how to get clients external IP in java extension

Posted: 08 Jul 2011, 13:36
by agrios
Once client is connected,
how can I access his WAN IP
in server side Java extension?

nobody?

I was able to get LAN IP with this:

Code: Select all

String checkIP(SocketChannel ch)
{
    return ch.socket().getInetAddress().getHostAddress();
}
but WAN IP seems like big NONO
with AS2 in current Adobe Flash player.
Seems like I can only get PHP output on local
domain... not from external server.
Obviously PHP server will be external to user.

Is even users external IP visible from SFS server?

Posted: 08 Jul 2011, 22:14
by BigFIsh
What you're using is correct.

I think if you use that for clients inside the same network in which the server is located on, you would get the LAN/private IP address. Have you tried that method for clients outside your network?

Posted: 10 Jul 2011, 16:09
by agrios
BigFIsh wrote: Have you tried that method for clients outside your network?
Yes, you are right, it works.
Outside of our LAN shows external IP.
Thanks BigFIsh!