Method to get host where the server is running
host as String
: whether to get the public address or just the local address