In Firefox (at least), if you hit ESC, then it will close all open WebSockets connections. I need to capture that disconnection and try to re-connect once it\'s available ag
You can attach a handler to the socket.onclose
event. It will be called when you hit ESC and the connection is interrupted.
See: http://jsfiddle.net/w5aAK/1/
One problem that you can't get around at the moment is the interrupted error being output to the console. There's no way of capturing that at the moment I'm afraid.