Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is the server down ? #671

Closed
ZauChoco opened this issue May 18, 2020 · 26 comments
Closed

Is the server down ? #671

ZauChoco opened this issue May 18, 2020 · 26 comments

Comments

@ZauChoco
Copy link

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

@Florrr
Copy link

Florrr commented May 20, 2020

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

@ZauChoco
Copy link
Author

There is no message in the console.

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

Nothing happen at all.

@bilo1967
Copy link

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);
});

@ZauChoco
Copy link
Author

ZauChoco commented May 21, 2020

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.

@ZauChoco
Copy link
Author

ZauChoco commented May 21, 2020

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.

@bilo1967
Copy link

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); 

@ZauChoco
Copy link
Author

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.

@Prior99
Copy link

Prior99 commented May 23, 2020

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"},
}

@Prior99
Copy link

Prior99 commented May 23, 2020

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.

@lnogueir
Copy link

lnogueir commented May 24, 2020

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?

@Florrr
Copy link

Florrr commented May 24, 2020

@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
Copy link

lnogueir commented May 24, 2020

@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.

@Prior99
Copy link

Prior99 commented May 25, 2020 via email

@HidalgoIvan
Copy link

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

@Florrr
Copy link

Florrr commented May 26, 2020

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)

@Prior99
Copy link

Prior99 commented Jul 11, 2020

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

@Txori
Copy link

Txori commented Jul 11, 2020

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?

@Prior99
Copy link

Prior99 commented Jul 11, 2020

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.

@Txori
Copy link

Txori commented Jul 13, 2020

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?

@bilo1967
Copy link

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.

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'},
		]
	},
});

@Txori
Copy link

Txori commented Jul 13, 2020

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

@afrokick
Copy link
Member

Sorry, we’ll restart it a little bit later

@Prior99
Copy link

Prior99 commented Jul 14, 2020

You need to specify secure: true, like so:

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

@Prior99
Copy link

Prior99 commented Jul 14, 2020

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

@Txori
Copy link

Txori commented Jul 17, 2020

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...

@jonasgloning
Copy link
Member

jonasgloning commented Mar 8, 2023

The server had some problems at that time. But our processes have improved a lot since then.
We had 99.98% uptime last year; 99% this year.
You can see our status page here: https://status.peerjs.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants