Use Socket.io instead of WebSockets
Get rid of reconnect logic - Socket.io handles this itself
add link to enable notifications on Firefox (which requires the function to be in response to a click event)
Try removing keep-alive stuff - Socket.io seems to be sending heartbeats
Try setting some production settings
A few other settings (commented out)
fix typo
Clean up socket setup to prevent duplicate event firings
Add a status indication