Implemented a first version of reading websocket messages from the socket.