how to connect to websocket and retrieve data