Quote Originally Posted by Hell-Lord
He asked for his IP when an internet connection is made. And that code will get him his localIP which is it. If there is no connection it will give him 127.0.0.1 obviously. And if he has established an internet connection then it will give him his IP
When on a network LocalIP is not the same as Internet IP. Most people use routers these days, so will need to contact an external service such as iPrank and DigiRev mentioned