diff --git a/lib/wsp/Peer.js b/lib/wsp/Peer.js index e8a0b3ae..42527e04 100644 --- a/lib/wsp/Peer.js +++ b/lib/wsp/Peer.js @@ -83,7 +83,8 @@ function Peer (url, options) { this.setMaxListeners(Infinity); this.options = options || {}; - this.options.wsc = options.wsc || { protocols: null }; + if( !('wsc" in this.options ) ) this.options.wsc = options.wsc || { protocols: null }; + else if( !("protocols" in this.options.wsc) ) this.options.wsc.protocols = null; // Messages sent before the socket is ready. this.deferredMsgs = [];