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
b57cfbea
authored
2020-04-16 08:03:15 +0000
by
Glitch (hello-express)
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
️
Checkpoint
./server.js:13690106/81
1 parent
04e5acbe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
server.js
server.js
View file @
b57cfbe
...
...
@@ -25,7 +25,7 @@ server.on('upgrade', async function (request, socket, head) {
// HOW HOW HOW ? IS it even possible to attach the WS to the Gun Object alone?
// Works only when passing "server" to the web parameter, no WS/WSS)
gun
.
server
=
new
WebSocket
.
Server
({
noServer
:
true
});
gun
.
gun
=
new
Gun
({
peers
:[],
ws
:
{
noServer
:
true
}
});
gun
.
gun
=
new
Gun
({
peers
:[],
ws
:
{
path
:
pathname
,
noServer
:
true
,
server
:
gun
.
server
},
web
:
server
});
lru
.
set
(
pathname
,
gun
);
}
}
...
...
@@ -34,7 +34,7 @@ server.on('upgrade', async function (request, socket, head) {
console
.
log
(
'handle connection...'
);
//ws.emit('connection', socket);
gun
.
server
.
handleUpgrade
(
request
,
socket
,
head
,
function
(
ws
)
{
console
.
log
(
'connecting.. '
)
console
.
log
(
'connecting
to gun
.. '
)
gun
.
server
.
emit
(
'connection'
,
ws
);
});
...
...
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