mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
Merge pull request #298 from d3x0r/patch-6
#297 passing options to websocket
This commit is contained in:
commit
096e224af5
@ -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 = [];
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user