joewalnes / reconnecting-websocket

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

Prevent reconnect when connection was closed by server #53

Open rgansevles opened 9 years ago

rgansevles commented 9 years ago

I would like to use this library to automatically reconnect in case of network failure. When the server closes the connection, the client should not reconnect. Currently this is not possible, after a close + time-out we always reconnect. There should be a way for the user of the library to decide, based on the close event to whether a reconnect should happen.

roundrobin commented 8 years ago

+1

nathanboktae commented 7 years ago

robust-websocket a library with a similar API and is aware of HTML5 offline/online events natively - check it out I bet it will meet your needs!