On Mon, 11 Nov 2013 20:29:09 GMT, Dicebot wrote:

However, as I have already said, I really don't recommend using such detection in any real project as it does not do what you may think it does. It essentially figures out what IP system hostname resolves to from the server itself. It is extremely reliant on server and network configuration and only happens to work if this hostname is exported to global DNS servers and your HTTP server is bound exactly to it and no local DNS server interferes. And probably lot of other possible issues that did not came to my mind at once.

What to you want to use it for? Maybe I can recommend a more robust alternative?

Well it is just for logging purpose. My vibe.d server backend reports whenever it starts (it is running as a monitored process) via email. I wanted to add the ip it is running on simply because i was used to do that with the nodejs code that served that same purpose befor. it helped me to quickly see which of those servers it was where the process had ended and got restarted.