On Mon, 11 Nov 2013 21:26:24 +0100, Sönke Ludwig wrote:

Am 11.11.2013 21:24, schrieb Dicebot:

On Mon, 11 Nov 2013 19:26:00 GMT, Stephan Dilly wrote:

I just know that I was able to query my ip on a nodejs server using dns.resolve(OS.hostname()) and it was the public IP as seen by external services for every listening interface.

This should be equivalent:

import std.socket : Socket;
import vibe.core.net : resolvehost;

auto ip = resolveHost(Socket.hostName);

Socket.hostName is nicer of course.

This crashes on win32 with this:
object.Exception@C:\Users\Stephan\AppData\Roaming\dub\packages\vibe-d-master\source\vibe\core\drivers\libevent2.d(201): Invalid IP address string: <PC-Name>