pladaria / reconnecting-websocket

Reconnecting WebSocket. For Web, React Native, cli (Node.js)
MIT License
1.22k stars 197 forks source link

allow to preemptively open a new websocket and switch to the new one atomically #137

Open jonenst opened 4 years ago

jonenst commented 4 years ago

Hi, I think it would be a nice addition to allow to configure the reconnecting-websocket to preemptively open a new connection periodically and switch messages to it atomically. This would allow to avoid message loss in the case when the connections are know to be cut off (by the server, or intermediate proxies. For example https://kubernetes.github.io/ingress-nginx/user-guide/miscellaneous/#websockets by default has a timeout of 60 seconds)