Change the default server to localhost.
Send lag information to clients. Handle errors in send.
Choose correct WS endpoint location dynamically in client.js.