More work on websocket handler.