This is probably what you are looking for (one of the code snippets does exactly what you want).

http://forum.world.st/Figuring-out-external-IP-addresses-of-network-interfaces-td4937291.html

As for services/websites you can query to get the public ip address, here's a short list (you'll have to modify the example above to parse the response correctly):

http://checkip.dyndns.com
https://www.whatismypublicip.com/
http://freegeoip.net
https://who.is/
http://www.ipchicken.com/
http://www.whatsmyip.org/
https://api.ipify.org/
https://whatismyipaddress.com/

IMHO, the simplest is api.ipify.org.  However, note that some of those service also answer geolocation info!


-----------------
Beno��t St-Jean
Yahoo! Messenger: bstjean
Twitter: @BenLeChialeux
Pinterest: benoitstjean
Instagram: Chef_Benito
IRC: lamneth
Blogue: endormitoire.wordpress.com
"A standpoint is an intellectual horizon of radius zero".  (A. Einstein)


On Wednesday, March 14, 2018, 6:08:41 AM EDT, Denis Kudriashov <dionisiydk@gmail.com> wrote:


Hello.

Do we have a way to retrieve IP address from Pharo?
I tried to use following code:

NetNameResolver addressForName: NetNameResolver localHostName 

But it either not works (dialog with retry give-up options) or returns localhost 127.0.0.1.

Best regards,
Denis