solution to translate a IM lan program into a WAN

hello i have creates a instant messanger program for LAN based network and now my next step is to operate it through the internet network just like msn messanger. i know how to get peoples ip address but the trouble is when someone is behind a router, its not soo easy because of their local ip address assigned to each PC hooked up to there own LAN.

is there a way to not only identify there global IP address, but there local IP as well if there behind a r outer..

[479 byte] By [acer_troublea] at [2007-10-3 3:05:13]
# 1
Not really, you need to get them to connect to your server. Their address and port will have been changed by their router or firewall and is likely to change when they reboot if they use DHCP.
pkwoostera at 2007-7-14 20:55:18 > top of Java-index,Java Essentials,Java Programming...
# 2
i see. at the moment my clients do connect to my server and the server stores there ip and port from the pc that they are currently connected to. the thing is with people behind a router this is a problem because the server has to find both there global ip and there local ip as well
acer_troublea at 2007-7-14 20:55:18 > top of Java-index,Java Essentials,Java Programming...
# 3

No, the server doesn't need their local address. All it needs is a connected socket. the local address is not unique, for example it could be 10.0.0.240 or 192.168.0.1, that's a private network address that is shared with thousands of other users globally, but is unique on their local network.

If you are planning to use IP address as a way to identify or restrict users, you should consider a different approach, since that is terribly insecure.

pkwoostera at 2007-7-14 20:55:18 > top of Java-index,Java Essentials,Java Programming...
# 4
so how will clients be able to talk to eachother?
acer_troublea at 2007-7-14 20:55:18 > top of Java-index,Java Essentials,Java Programming...
# 5
Clients talk to each other by having the server relay their messages using the sockets they establish with the server.
pkwoostera at 2007-7-14 20:55:18 > top of Java-index,Java Essentials,Java Programming...