If you want the public IP address, the only way is to ask a server on the Internet to tell you what your outside address appears to be. You can do this by AJAX requesting a server, e.g. https://api.ipify.org (note: I don't know if that site has rate limits or accounts or what, it just demonstrates how it works)