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
b2c715bd
authored
2020-05-01 16:15:17 +0200
by
Jabis Sevón
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
room creation
1 parent
33970cbd
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
mem.js
server.js
mem.js
View file @
b2c715b
...
...
@@ -22,11 +22,11 @@
return
;
}
to
=
setTimeout
(
flush
,
opt
.
wait
||
1
);
var
id
=
at
[
'#'
]
ctx
.
on
(
'in'
,
{
"@"
:
id
,
ok
:
1
})
//
var id = at['#']
//
ctx.on('in', {"@": id, ok:1})
});
ctx
.
on
(
'get'
,
function
(
at
){
console
.
log
(
"get at"
,
at
,
disk
);
//
console.log("get at",at,disk);
this
.
to
.
next
(
at
);
var
lex
=
at
.
get
,
soul
,
data
,
opt
,
u
;
//setTimeout(function(){
...
...
@@ -47,7 +47,7 @@
var
wait
;
var
flush
=
function
(){
console
.
log
(
"flushing"
,
to
);
//
console.log("flushing",to);
if
(
wait
){
return
}
wait
=
true
;
clearTimeout
(
to
);
...
...
server.js
View file @
b2c715b
...
...
@@ -47,10 +47,9 @@ server.on("upgrade", async function(request, socket, head) {
let
pathname
=
parsed
.
pathname
||
"/gun"
;
if
(
debug
)
console
.
log
(
"Got WS request"
,
pathname
);
let
roomname
=
pathname
.
split
().
slice
(
1
).
join
(
""
);
console
.
log
(
"roomname"
,
roomname
);
var
gun
=
{
gun
:
false
,
server
:
false
};
if
(
pathname
)
{
let
roomname
=
pathname
.
split
(
""
).
slice
(
1
).
join
(
""
);
if
(
lru
.
has
(
pathname
))
{
// Existing Node
if
(
debug
)
console
.
log
(
"Recycle id"
,
pathname
);
...
...
@@ -106,9 +105,10 @@ server.on("upgrade", async function(request, socket, head) {
});
}
else
{
;(
async
()
=>
{
Object
.
assign
(
obj
,{
passwordProtected
:
false
});
let
roomnode
=
g
.
get
(
"rtcmeeting"
).
get
(
roomname
).
put
(
obj
);
let
rack
=
await
roomnode
.
then
();
console
.
log
(
"room created"
,
ack
);
console
.
log
(
"room created"
,
r
ack
);
})()
}
}
...
...
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