diff --git a/lib/ws.js b/lib/ws.js index a37da6b7..66b3a8fa 100644 --- a/lib/ws.js +++ b/lib/ws.js @@ -19,7 +19,7 @@ Gun.on('opt', function mount(ctx){ ws.server = ws.server || opt.web; ws.path = ws.path || '/gun'; - ws.web = new WebSocket.Server(ws); + if (!ws.web) ws.web = new WebSocket.Server(ws); ws.web.on('connection', function(wire){ wire.upgradeReq = wire.upgradeReq || {};