Guess hostname and port automatically

Signed-off-by: Bas Westerbaan <bas@westerbaan.name>