
Checkpoint
./server.js:13690106/702
Showing
2 changed files
with
10 additions
and
2 deletions
1 | {"j":{"ack\u001bname":{"":{":":"Jack",">":1587032994032}},"ill\u001bname":{"":{":":"Jill",">":1587032608228.001}}}} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | {"j":{"ack\u001bname":{"":{":":"Jack",">":1587037784462}},"ill\u001bname":{"":{":":"Jill",">":1587037784464.001}}},"zero":{"1\u001bname":{"":{":":"Jack",">":1587038341751}},"2\u001bname":{"":{":":"Jill",">":1587038341752.001}}}} | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -25,7 +25,15 @@ server.on('upgrade', async function (request, socket, head) { | ... | @@ -25,7 +25,15 @@ server.on('upgrade', async function (request, socket, head) { |
25 | console.log('Create id',pathname); | 25 | console.log('Create id',pathname); |
26 | // NOTE: Only works with lib/ws.js shim allowing a predefined WS as ws.web parameter in Gun constructor | 26 | // NOTE: Only works with lib/ws.js shim allowing a predefined WS as ws.web parameter in Gun constructor |
27 | gun.server = new WebSocket.Server({ noServer: true, path: pathname}); | 27 | gun.server = new WebSocket.Server({ noServer: true, path: pathname}); |
28 | gun.gun = new Gun({peers:[], localStorage: false, file: false, ws: { noServer: true, path: pathname, web: gun.server }, web: gun.server }); | 28 | console.log('set peer',request.headers.host+pathname); |
29 | gun.gun = new Gun({ | ||
30 | peers:[], // should we use self as peer? | ||
31 | localStorage: false, | ||
32 | file: false, | ||
33 | ws: { noServer: true, path: pathname, web: gun.server }, | ||
34 | web: gun.server | ||
35 | }); | ||
36 | gun.gun.on("in", function(msg) { console.log('got',msg) }); | ||
29 | lru.set(pathname,gun); | 37 | lru.set(pathname,gun); |
30 | } | 38 | } |
31 | } | 39 | } | ... | ... |
-
Please register or sign in to post a comment