Closed bilo1967 closed 5 years ago
Hi, it looks latest PeerServer version is not stable yet. @afrokick was developing it. Meanwhile you should be ok with the version of the public server which I've published in the branch: v0.2.9 test it and write if it works in your case.
PD: I wouldn't recommend to let PeerServer (or any NodeJS service) to manage SSL. Public PeerServer SSL is managed by a bastion Caddyserver.
Hi, it looks latest PeerServer version is not stable yet. @afrokick was developing it. Meanwhile you should be ok with the version of the public server which I've published in the branch: v0.2.9 test it and write if it works in your case.
Seems like it's working fine, thank you!
PD: I wouldn't recommend to let PeerServer (or any NodeJS service) to manage SSL. Public PeerServer SSL is managed by a bastion Caddyserver.
Ok. Is there any guide to configure Caddy to proxy the PeerServer?
Silly question. I found it googling a while. It seems that dowloading caddy with http.cors plugin and the following config file does the job:
my.domain.tld:9443 {
proxy / http://localhost:9000 {
websocket
}
cors / {
origin *
methods POST,PUT,GET
allowed_headers Content-Length,range
exposed_headers Content-Length,range
}
tls /etc/letsencrypt/live/my.domain.tld/cert.pem /etc/letsencrypt/live/my.domain.tld/privkey.pem
}
As easy as:
Caddyfile:
0.peerjs.com {
proxy / http://localhost:9000 {
websocket
}
tls your@email.com
}
Then execute caddy
where you have your config.
I don't think it's related to clients trying to connect to non existing peers.
Looking at the code in question, I'm not sure what it was even supposed to be doing:
TypeError: Cannot destructure property `realm` of 'undefined' or 'null'.
at module.exports (/home/___/peerjs-server/src/messageHandler/index.js:24:18)
at pruneOutstanding (/home/___/peerjs-server/src/services/messagesExpire/index.js:23:11)
at Timeout.setTimeout [as _onTimeout] (/home/___/peerjs-server/src/services/messagesExpire/index.js:45:7)
at ontimeout (timers.js:498:11)
at tryOnTimeout (timers.js:323:5)
at Timer.listOnTimeout (timers.js:290:5)
messageHandler
line 24:
module.exports = ({ realm }) => {
messagesExpire
around line 23:
if (!seen[message.src]) {
messageHandler(null, {
type: MessageType.EXPIRE,
src: message.dst,
dst: message.src
});
seen[message.src] = true;
}
It straight up calls a single argument function with two arguments, first of them being null. I see no way for this code to not crash under any condition. Seems that someone made a PR for this already, though I'm not sure if that is enough since the second argument is never read, either.
@bilo1967 we fixed some bugs, could you please try to check the latest version from master branch?
@bilo1967 we fixed some bugs, could you please try to check the latest version from master branch?
Did just a quick test and it seems to work fine. I'll keep this version of the server and let you know if there are problems.
Ok, please reopen an issue if it still exists
See details about my setup below. This is the issue;
Error: TypeError: Cannot destructure property 'realm' of 'undefined' or 'null'
The same code works fine if I connect to the public server.
Any clue?
My setup:
I've set up a plain-vanilla PeerJS server on my CentOS6 distro. I've made no changes to the server code and I start it with:
In /opt/peerjs-server/config/index.js I have:
P.S. Where do I find the server log file and how do I set the server log level?