From 266b18109c423e073a0aa9717a596655729c7c79 Mon Sep 17 00:00:00 2001 From: d3x0r Date: Fri, 23 Dec 2016 00:35:11 -0800 Subject: [PATCH 1/2] Missed a change to get the options.... Somehow my other options test didn't work... had to add something like this. Now I feel this is such a huge hack --- lib/wsp/client.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/wsp/client.js b/lib/wsp/client.js index 80b408f6..62b6e8d3 100644 --- a/lib/wsp/client.js +++ b/lib/wsp/client.js @@ -74,6 +74,7 @@ Gun.on('opt', function (context) { if (sockets[url]) { return; } + if (!options.wsc) options.wsc = gun.Back('opt.wsc') || { protocols:null }; var socket = Socket(url, options); sockets.add(url, socket); From a4425bda24c7c927cd03fd1b113efb85d77d0bea Mon Sep 17 00:00:00 2001 From: d3x0r Date: Fri, 23 Dec 2016 00:43:05 -0800 Subject: [PATCH 2/2] remove redundant option fetch since options have to be fetched higher anyway... Or rather - this options is outside of knowing gun options --- lib/wsp/Peer.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/wsp/Peer.js b/lib/wsp/Peer.js index e64bd63c..11f1069c 100644 --- a/lib/wsp/Peer.js +++ b/lib/wsp/Peer.js @@ -83,8 +83,6 @@ function Peer (url, options) { this.setMaxListeners(Infinity); this.options = options || {}; - if( !('wsc' in this.options ) ) this.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 = [];