I am currently working on a Java-based game that can be played P2P, without a server. So far, I have been able to get it working, where one person enters the other's IP, which I get with the call
InetAddress.getLocalHost().getHostAddress());
However, this only works when two computers on the same network. How would I get an IP that works across networks? Thanks for you help!
edit: It is a 1v1 game, so multiple connections are not a problem. And I was going to have users send IPs over skype or something... this is just something I want to use with my friends. Ex. It displays the IP, you send it to your friend, he connects using it.