pladaria / reconnecting-websocket

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

Disable reconnect after creating instance #70

Closed TimPietrusky closed 6 years ago

TimPietrusky commented 6 years ago

I wonder how I can disable the reconnect after I created an instance of ReconnectingWebSocket. What I tried is using close, but it's still trying to reconnect:

let connection = new ReconnectingWebSocket('ws://localhost:3000');
connection.close();

Version

wd commented 6 years ago
rws.close(1000, 'user logout', {keepClosed: true, fastClose: true});
pladaria commented 6 years ago

Thanks for reporting, will be fixed in next release