From d46db34d45476e4249b7d6a75d541d96460ebe21 Mon Sep 17 00:00:00 2001 From: Zane Hitchcox Date: Fri, 24 Mar 2017 12:56:11 -0400 Subject: [PATCH] add default path for gun --- lib/uws.js | 3 ++- lib/wsp/server.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/uws.js b/lib/uws.js index 984fd3fc..d574ca1a 100644 --- a/lib/uws.js +++ b/lib/uws.js @@ -13,6 +13,7 @@ Gun.on('opt', function mount(at){ var cat = (at.gun.back(-1)._); opt.server = opt.server || at.opt.web; + opt.path = opt.path || at.opt.path || '/gun'; opt.web = new WebSocket.Server(opt); var peers = cat.opt.peers; @@ -116,4 +117,4 @@ function reconnect(peer, as){ peer.defer = setTimeout(function(){ open(peer, as); }, 2 * 1000); -} \ No newline at end of file +} diff --git a/lib/wsp/server.js b/lib/wsp/server.js index 15740c80..6ef38671 100644 --- a/lib/wsp/server.js +++ b/lib/wsp/server.js @@ -15,6 +15,7 @@ Gun.on('opt', function (at) { var gun = at.gun, opt = at.opt; gun.__ = at.root._; gun.__.opt.ws = opt.ws = gun.__.opt.ws || opt.ws || {}; + gun.__.opt.ws.path = gun.__.opt.ws.path || '/gun'; if(gun.__.opt.web){ setTimeout(function(){