Repairs example code and adds example code for websocket connection.