Add websocket.js file and fix test