Merge pull request #930 from lmangani/patch-1

Allow externally provided websockets in constructor
This commit is contained in:
Mark Nadal 2020-04-19 06:46:58 -07:00 committed by GitHub
commit 5bedffc864
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 || {};