Converting to socket.io