joewalnes / reconnecting-websocket

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

Pull request for issue 53, do not reconnect when the connection was closed by the client #54

Open rgansevles opened 9 years ago

rgansevles commented 9 years ago

My client checks the event code in onconnecting(evt), when this is not a network-error it will call close() on the reconnecting websocket. The proposed fix then will stop reconnecting.