Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Could anyone list some practical uses ?


Finding your own external, visible-to-the-internet IP. You're almost always behind some router these days, so using ifconfig or whatever is pretty useless.


I built some WebSocket code that calls back to the server. I can't hardcode the "server" ip address because I want to deploy it to different places at different times. Sometimes I'm working on my laptop, sometimes its running on Amazon EC2, etc. So, with something like this I am able to build my Javascript so it always knows how to get back to the server.

<yea, I know there are lots of ways to do this, but this is the one I chose. :) sue me. >


So myipinjosin returns the server's IP address? I thought it would return the clients IP address. (Link is broken atm).

For your use case, relative URLs seem the better solution?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: