joewalnes / reconnecting-websocket

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

`timeoutInterval` must be set as an option to take effect on the first connection #74

Open STRd6 opened 8 years ago

STRd6 commented 8 years ago

This example doesn't work with timeoutInterval because it needs to be present when the socket autoconnects the first time.

var socket = new ReconnectingWebSocket(url);
socket.debug = true;
socket.timeoutInterval = 5400;

It's only possible to set the timeoutInterval in the options param. Just wanted to note this since it is the example in the docs. The other options are fine though.