This kind of service is exactly what STUN servers are made for. Designed to be used with webrtc, but it works perfectly alright by itself.<p>There are a plethora of unauthenticated STUN servers around, and while there's still room for abuse, the protocol is a bit more lightweight than full-blown http requests, and faster, too!<p>I've dabbled with doing this on my own, but I've found `myip` to do the job nicely and without hassle:<p><a href="https://github.com/Snawoot/myip" rel="nofollow">https://github.com/Snawoot/myip</a>