improved websocket js-client