improved websocket client example