Migrating from socket.io to WS