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
4cd6a320
authored
2020-04-15 17:40:11 +0000
by
Glitch (hello-express)
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Checkpoint
./server.js:13690106/1091
1 parent
f0b3bec7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
server.js
server.js
View file @
4cd6a32
var
Gun
=
require
(
'gun'
);
var
server
=
require
(
'http'
).
createServer
().
listen
(
3000
);
var
gun1
=
Gun
({
web
:
server
,
path
:
'/gun1'
});
var
gun2
=
Gun
({
web
:
server
,
path
:
'/gun2'
});
\ No newline at end of file
var
http
=
require
(
'http'
);
var
server
=
http
.
createServer
().
listen
(
300
);
var
wss_event
=
new
WebSocket
.
Server
({
noServer
:
true
});
server
.
on
(
'upgrade'
,
function
(
request
,
socket
,
head
)
{
var
pathname
=
url
.
parse
(
request
.
url
).
pathname
;
if
(
pathname
===
'/sim_world'
)
{
wss_event
.
handleUpgrade
(
request
,
socket
,
head
,
function
(
ws
)
{
wss_event
.
emit
(
'connection'
,
ws
);
});
}
else
{
socket
.
destroy
();
}
});
\ No newline at end of file
...
...
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