implemented feature-request #157 and #160, configurable hostname and port number