6e7b43f0 by Glitch (hello-express)

:shaved_ice::circus_tent: Checkpoint

./server.js:13690106/188
1 parent fb15a17b
...@@ -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.. ')
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!