Chat client in JS with WebSockets