Peerjs: Is the server down ?

Created on 18 May 2020  ·  25Comments  ·  Source: peers/peerjs

Hello,

Everything worked perfectly, but suddenly since yesterday, it doesn't work anymore. I can connect to it but messages aren't received. (I didn't touch anything)
What happened ? How to fix this ?

Thank you

Most helpful comment

@lnogueir
I'm pretty sure it would solve the problem - yes. I'm running my own peer-js server for about a month now with hundreds of calls each day without such problems.
Its relatively easy to setup the server using https://github.com/peers/peerjs-server

EDIT: Since 0.peerjs.com is a signaling-server and not a stun/turn-server its probably an issue with the public peerjs signaling-server

All 25 comments

I'd recommend providing the console's output for a detailed problem description.
Also keep in mind, that the publicly available PeerServer could reach its max-connection at any given time (happened to me before). Consider running a signaling server yourself

There is no message in the console.

Here is my source code:
https://pastebin.com/xXSy8S3M

Nothing happen at all.

Does the peer you're trying to connect to exist?
You should add the error handler to check what's going wrong
This should fit your code:

peer.on('error', function(err) {
    console.log("Error: ", err);
});

Does the peer you're trying to connect to exist?
You should add the error handler to check what's going wrong
This should fit your code:

peer.on('error', function(err) {
    console.log("Error: ", err);
});

Yes, the peer ID exist, and with the error handler i don't get anything.

In the documentation, i just read "API key for the cloud PeerServer. This is not used for servers other than 0.peerjs.com." in the doc, is-it new ? Because I don't use one.

I'm very confused, everything worked fine.

Firefox sometimes give an error:
Firefox cannot establish a connection with the server at the address wss://0.peerjs.com/peerjs?key=peerjs&id=123222589562487856955685485555&token=ocyxworx62i.

In the network tab i get the 101 HTTP code.

The public TURN server seems actually down but STUN should be OK.
Try to specify port, SSL and a few iceServer.

const Config = {
    secure: true,
    port: 443,
    iceServers: [
        { urls: 'stun:stun.l.google.com:19302'  }, 
        { urls: 'stun:stun1.l.google.com:19302' }, 
        { urls: 'stun:stun2.l.google.com:19302' }, 
    ]
};

var peer = new Peer(Config); 

The public TURN server seems actually down but STUN should be OK.
Try to specify port, SSL and a few iceServer.

const Config = {
    secure: true,
    port: 443,
    iceServers: [
        { urls: 'stun:stun.l.google.com:19302'  }, 
        { urls: 'stun:stun1.l.google.com:19302' }, 
        { urls: 'stun:stun2.l.google.com:19302' }, 
    ]
};

var peer = new Peer(Config); 

Thank you, I tried but it's the same.
"connection", "open" and "error" events aren't fired.

It's a waste of time, i liked this librairie but I'll search for an alternative.

The server seems to be unstable and/or overloaded. When trying to connect to 0.peerjs.com server I often get either

  • A bad HTTP status code
  • A timeout
  • A message in the Websocket telling me that the server's limit is reached

The aforementioned message looks like this:

{
    "type":"ERROR",
    "payload":{"msg":"Server has reached its concurrent user limit"},
}

Would the maintainers of the server consider upgrading it? I would be willing to make a one-time donation or if necessary a recurring one.

I have the same issue. Everything was working perfectly, now all of a sudden I can't connect to the servers and keep getting:
peer.min.js:1 POST https://0.peerjs.com/peerjs/wun5gx7lj7000000/141ot3fd9cwf/id?i=1 net::ERR_TIMED_OUT
Is this an issue with peerjs servers or the public STUN and TURN servers?

@lnogueir
I'm pretty sure it would solve the problem - yes. I'm running my own peer-js server for about a month now with hundreds of calls each day without such problems.
Its relatively easy to setup the server using https://github.com/peers/peerjs-server

EDIT: Since 0.peerjs.com is a signaling-server and not a stun/turn-server its probably an issue with the public peerjs signaling-server

@lnogueir
I'm pretty sure it would solve the problem - yes. I'm running my own peer-js server for about a month now with hundreds of calls each day without such problems.
Its relatively easy to setup the server using https://github.com/peers/peerjs-server

I'll try to set it up. Thanks!

EDIT:
@Florrr
Setting up my own peerjs server fixed all my timeout issues and everything is back to normal.
Again, thanks.

Would it be a good idea to provide the peerjs instance not with one, but
instead a list of servers and then select one that isn't timeouting? The
signaling Id could then also contain the signaling server URL. We could
then maintain a list of globally available servers.

On Mon, 25 May 2020, 04:57 Lucas Nogueira, notifications@github.com wrote:

@Florrr https://github.com/Florrr
Setting up my own peerjs server fixed all my timeout issues and everything
is back to normal.
Again, thanks.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/peers/peerjs/issues/671#issuecomment-633351840, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AALME5UNSH456EHDNAPZ7HDRTHNDHANCNFSM4NEJLYXA
.

Is the server unstable again? I am working on an app that uses this library and ~16 hours ago it was working just fine, now it the connection just times out

Would it be a good idea to provide the peerjs instance not with one, but instead a list of servers and then select one that isn't timeouting? The signaling Id could then also contain the signaling server URL. We could then maintain a list of globally available servers.

I doubt that that's possible, since both peers need to connect to the same signaling server. If you are choosing the signaling server (more or less) randomly, you cannot guarantee that the same server is used.

@HidalgoIvan I'm not the maintainer of the server - so I don't know about the current status of the server. But since the signaling-server seems to be unstable, I'd recommend setting up your own one. As mentioned before this should be relatively cheap and easy to do. (In addition you are able to modify the server to add additional functionalities)

Feel free to use mine, though no guarantees regarding uptime: https://peerjs.92k.de/

Thanks @Prior99 , but since I started making my own server this morning, I would like to finish. I installed peerjs using docker. And if I open port 9000 on my server, this is working, more or less. Problem is that it only works with the ip address, which isn't ssl, not the website address, which is. How did you manage to use peerjs.92k.de as the server address instead of the ip address?

I instrumented a Hetzner server with ansible. You can check the configuration here: https://gitlab.com/prior99/peerjs-server

The important part is using a reverse proxy that handles ssl for you. I am using caddy, as all that I need to do are two lines of confirmation.

Hi @Prior99 , sorry to bother you, but I am utterly lost with all the things I need to learn to run my server...
So I finally planned to use yours until I manage to have my proper server. Unfortunately, I can't get yours to work either... I'm creating the peer with:

var peer = new Peer({
    host: 'peerjs.92k.de',
    port: 443,
    debug: 3
});

It seems to work as I get an ID, but I can't get one peer to connect to another. And this was working perfectly using 0.peerjs.com, I didn't touch anything in my code. Am I creating the peer correctly?

It seems to work as I get an ID, but I can't get one peer to connect to another. And this was working perfectly using 0.peerjs.com, I didn't touch anything in my code. Am I creating the peer correctly?

Peers are created correctly but you still need STUN and TURN servers. STUN are not a problem: there are many you can use free of charge. But you definitely need a TURN server (possibly your own) to make peers able to connect when they're behind a symmetrical NAT.

:javascript var peer = new Peer({ host: 'peerjs.92k.de', port: 443, debug: 3, config: { iceServers: [ { urls: 'stun:stun.l.google.com:19302' }, { urls: 'stun:stun1.l.google.com:19302' }, ..., { urls: 'turn:your.own.host:3478', username: 'someuser', credential: 'somepass'}, ] }, });

So I tried a lot of combinations and it's still not working. I'm behind a normal NAT.
Here's the setup:

var peer = new Peer({
    host: 'peerjs.92k.de',
    port: 443,
    config: {'iceServers': [
            { url: 'stun:stun.l.google.com:19302' },
            { url: 'stun:stun1.l.google.com:19302' },
            { url: 'stun:stun2.l.google.com:19302' },
            { url: 'stun:stun3.l.google.com:19302' },
            { url: 'stun:stun4.l.google.com:19302' }
        ]
    },
    debug: 3
});

And I set up the basic example with it. Can you try and see if it works for you?
https://www.txori.com/peerjs

Sorry, we’ll restart it a little bit later

You need to specify secure: true, like so:

new PeerJS(null, { host: "peerjs.92k.de", secure: true });

I published a number of games which seem to work fine in many browsers on different platforms and in different network setups using my server.

For example:
https://gitlab.com/prior99/frabble
https://prior99.gitlab.io/frabble/#/main-menu

Thanks @Prior99 , but even using secure: true, I can't get it to work. After two days of try and repeat, it appears that this isn't coming from your server. Since then, I tried with many others and the result is always the same: I manage to obtain the peer code, but nothing else. The weird thing is that everything works perfectly if I use basic setup connect to 0.peerjs.com (when the server is up...).
I really don't understand what's going on...

Was this page helpful?
0 / 5 - 0 ratings