joewalnes / reconnecting-websocket

A small decorator for the JavaScript WebSocket API that automatically reconnects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reconnection is not always triggered

andreififiita opened this issue · comments

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.