demo code for websocket