Revert "Fixed: some device will get error code [1006] when handshake if protocols is undefined. (#691)"

This reverts commit ed32c71d90.
This commit is contained in:
Andrew Godwin 2017-09-12 09:19:25 -07:00
parent ed32c71d90
commit f34ca1cd2b

View File

@ -115,12 +115,7 @@ var ReconnectingWebsocket = function (url, protocols, options) {
var connect = function () { var connect = function () {
log('connect'); log('connect');
var oldWs = ws; var oldWs = ws;
if (protocols === undefined) { ws = new config.constructor(url, protocols);
ws = new config.constructor(url);
} else {
ws = new config.constructor(url, protocols);
}
connectingTimeout = setTimeout(function () { connectingTimeout = setTimeout(function () {
log('timeout'); log('timeout');
ws.close(); ws.close();