joewalnes / reconnecting-websocket

A small decorator for the JavaScript WebSocket API that automatically reconnects
MIT License
4.21k stars 968 forks source link

Reconnection is not always triggered #61

Open andreififiita opened 8 years ago

andreififiita commented 8 years ago

Sometimes, when the connection is lost and back up again (for example laptop goes in standby, and then i re-open it and reconnect to the wifi) the websocket re-connection is not triggered. But it can take about 5 or 10 minutes, and sometimes it doesn't reconnect at all. I believe this also depends on the browser (in Safari this happens all the time for me). Is there a way to trigger or check the connection periodically, without having to implement something like a custom ping/pong that involves server coding? Thank you.