replace raw websocket with socket.io