implementing websocket client