Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Jabis Sev贸n
/
gun-multiserver
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
6e7b43f0
authored
2020-04-15 23:26:14 +0000
by
Glitch (hello-express)
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Checkpoint
./server.js:13690106/188
1 parent
fb15a17b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
server.js
server.js
View file @
6e7b43f
...
...
@@ -22,14 +22,14 @@ server.on('upgrade', async function (request, socket, head) {
}
else
{
// Create Node
console
.
log
(
'Create id'
,
pathname
);
var
w
server
=
new
WebSocket
.
Server
({
noServer
:
true
});
gun
=
new
Gun
({
peers
:[],
ws
:
{
path
:
pathname
},
web
:
wserver
});
lru
.
set
(
pathname
,
{
gun
:
gun
,
server
:
wserver
}
);
gun
.
server
=
new
WebSocket
.
Server
({
noServer
:
true
});
gun
.
gun
=
new
Gun
({
peers
:[],
ws
:
{
noServer
:
true
,
path
:
pathname
}
});
lru
.
set
(
pathname
,
gun
);
}
}
if
(
gun
.
server
){
// Handle Request
console
.
log
(
'handle connection...'
,
gun
);
console
.
log
(
'handle connection...'
);
//ws.emit('connection', socket);
gun
.
server
.
handleUpgrade
(
request
,
socket
,
head
,
function
(
ws
)
{
console
.
log
(
'connecting.. '
)
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment