Add support for custom host/port

I needed to be able to override the port for the websocket connection (in order to make it coexist with a socket io connection). Hence this little patch.