I just wanted to put this out there to get some feedback from others on this mailing list:
On my fork of Faye, I've put a ping response timeout on the websocket transport, meaning that after the transport pings the server by sending an empty envelope message ("[]"), I start a timeout waiting for a response.
If it doesn't receive a message via the socket within the timeout period, I close the socket and create a new one.
This seems to have led to a big improvement in handling dodgy websockets. We see a fair few of these dodgy sockets, particularly over bad networks. The easiest way for me to recreate a dodgy socket (in Chrome at least) is by establishing a websocket, the switching Wifi networks to one going through a different ADSL network, or switching over to a 3G tethering. After doing this, the Chrome websocket becomes really useless. I doesn't send, but also won't error.
I'm not sure whether this problem is particular to my setup, as we're passing out websockets through a AWS ELB (in TCP mode) but whatever causes it, it causes us a lot of headaches.
Anyone else seeing this problem / dealing with it in the same / a different way?
Thanks
Andrew