
Checkpoint
./server.js:13690106/188
Showing
1 changed file
with
4 additions
and
4 deletions
... | @@ -22,14 +22,14 @@ server.on('upgrade', async function (request, socket, head) { | ... | @@ -22,14 +22,14 @@ server.on('upgrade', async function (request, socket, head) { |
22 | } else { | 22 | } else { |
23 | // Create Node | 23 | // Create Node |
24 | console.log('Create id',pathname); | 24 | console.log('Create id',pathname); |
25 | var wserver = new WebSocket.Server({ noServer: true}); | 25 | gun.server = new WebSocket.Server({ noServer: true}); |
26 | gun = new Gun({peers:[], ws: { path: pathname}, web: wserver }); | 26 | gun.gun = new Gun({peers:[], ws: { noServer: true, path: pathname} }); |
27 | lru.set(pathname,{gun: gun, server: wserver}); | 27 | lru.set(pathname,gun); |
28 | } | 28 | } |
29 | } | 29 | } |
30 | if (gun.server){ | 30 | if (gun.server){ |
31 | // Handle Request | 31 | // Handle Request |
32 | console.log('handle connection...', gun); | 32 | console.log('handle connection...'); |
33 | //ws.emit('connection', socket); | 33 | //ws.emit('connection', socket); |
34 | gun.server.handleUpgrade(request, socket, head, function (ws) { | 34 | gun.server.handleUpgrade(request, socket, head, function (ws) { |
35 | console.log('connecting.. ') | 35 | console.log('connecting.. ') | ... | ... |
-
Please register or sign in to post a comment