peers / peerjs

Simple peer-to-peer with WebRTC.
https://peerjs.com
MIT License
12.2k stars 1.42k forks source link

peerjs cdn Error: Could not get an ID from the server #937

Closed Rajcbe closed 2 years ago

Rajcbe commented 2 years ago

Using Peerjs cdn.It stopped working suddenly from today in my project.Cannot generate any id using it.

xerosanyam commented 2 years ago

+1, no error, no logs. just stops working

same for you @Rajcbe ?

Rajcbe commented 2 years ago

@xerosanyam yes.Demo application given by peerjs in their documentation also has same issue from today https://jmcker.github.io/Peer-to-Peer-Cue-System/

xerosanyam commented 2 years ago

@Rajcbe but this one https://glitch.com/~peerjs-video seems to work fine 🤔

Rajcbe commented 2 years ago

@xerosanyam for above application has seperate node server is configured.But i need to use cdn peerjs cloud server

andrecj93 commented 2 years ago

Hello, I have the same problem. Any ideas when will this be available?

Proof: https://prnt.sc/WaltSFvGSyGO

topheman commented 2 years ago

I have the same problem: https://topheman.github.io/webrtc-experiments/

davedodea commented 2 years ago

Same here, any timeline on it 0.peerjs.com coming back up?

... WebSocket connection to 'wss://0.peerjs.com/peerjs?key=peerjs&id=... failed: 
SinisterSpatula commented 2 years ago

+1 also seeing a problem with the 0.peerjs.com server. We're unable to get an ID. The peer-to-peer cue system demo also shows "unable to get ID".

marcomow commented 2 years ago

I solved hosting my own service, it's unexpectedly easy!

Just deploy using this button https://elements.heroku.com/buttons/peers/peerjs-server, it's really straight-forward. Once the deployment is running, use the app's url in the config like this

const myPeer = new Peer( {
     secure:true,
     host: 'my-peerjs-server-name.herokuapp.com', // change here the herokuapp name
     port: 443
})

And everything just works!

SinisterSpatula commented 2 years ago

Thanks for sharing @marcomow I may need to resort to that, but would rather not, as I'd have to re-distribute my app to the users in order to change the peerjs server domain. But it's good to know there is that option.

julienreszka commented 2 years ago

@marcomow Thank you it was surprisingly easy indeed. I could do it in less than 10 minutes.

kunalkashyap855 commented 2 years ago

Thank you for the alternative @marcomow. I'd still like to know if anyone knows till when we can expect 0.peerjs.com server to be back up?

kidandcat commented 2 years ago

Hi guys, public server is down, it looks like it has been cracked into by a botnet by looking at the resource monitors. It just need to be reinstalled and configured with a PeerServer instance.

I'm not sure I can spend more time to this project, so I think this is a good chance to let the maintenance of this ecosystem to other person. I'll open an issue to search for volunteers.

PD: Expect maybe a couple of days of downtime, as I want to take advantage of the issue to move the servers to the new maintaner's preferred location.

andrecj93 commented 2 years ago

Well this made me do something that I should have done it in a while. And that is to configure my own PeerServer instance. Thanks for your work.

I-Chandana commented 2 years ago

Thank You @marcomow
It works for me.

Rajcbe commented 2 years ago

Thank You @marcomow .Working after creating separate server instance

kenfouo commented 2 years ago

here is my solution with Nodejs

------- server

by setting secure to false it should work without the crimps.

const { PeerServer } = require('peer'); const fs = require('fs'); var crypto = require("crypto");

const customGenerationFunction = () => crypto.randomBytes(20).toString('hex');

const options = { key: fs.readFileSync('xxxxxxx.pem'), cert: fs.readFileSync('xxxxxxx.pem') };

const peerServer = PeerServer({ port: 5000, generateClientId: customGenerationFunction, ssl: options, });

in the search bar this address returns me the peerID but my client does not work. https://myserve.com:port/peerjs/id ==> 62f4b9248b173e45d02225682fbb99e0072fbbb9

------- my client:

_FM_Peer_Object = new Peer({ secure : true, host : 'myserve.com', // do not add "https://" to the server address port : port });

Bingo it's okey for me !!!!!!!

jsProj commented 2 years ago

Yeah had to host my own heroku instance, kinda fucky altogether, but it works for now, hopefully someone can take over the project and get 0.peerjs.com working again

ClintonWeeYuan commented 2 years ago

Hi everyone. For some reason. My own peer server works perfectly when run on the localhost. However, once I launch to herokuapp, it fails to connect. I get the following error message.

image

I suspect it has something to do with how i call the server in my client: const peer = new Peer(userId, { host: 'videocall-peer-server.herokuapp.com', port: 9000, debug: 2, path: '/peerjs/myapp' });

ClintonWeeYuan commented 2 years ago

@julienreszka Thanks for that. But does that mean I need to set up my own STUN & TURN servers?

SinisterSpatula commented 2 years ago

@ClintonWeeYuan try removing the path option, and change port to 443, and add secure:true, That is how mine is and it works. I also do no use any ice/stun servers it's working for me on heroku without those, but that probably will depend on your client devices and if they are behind restrictive NAT firewalls/vpns etc.

ClintonWeeYuan commented 2 years ago

@SinisterSpatula Thanks for that. However, it still doesn't work. I think the path option is correct, because when I run the server on localhost it works, it just doesn't work when i run the server on herokuapp. How did you set up your peer server?

SinisterSpatula commented 2 years ago

@ClintonWeeYuan I did it exactly how Marcomow says above: https://github.com/peers/peerjs/issues/937#issuecomment-1077712367 no path needs to be specified, set secure to true and port to 443 and just single click deploy on heroku, should be easy as that.

ClintonWeeYuan commented 2 years ago

@SinisterSpatula Ohh yes it works now! Thank you =)

luismen97 commented 2 years ago

@SinisterSpatula Hi, you can help me? I don´t know where change this code:

const myPeer = new Peer( { secure:true, host: 'my-peerjs-server-name.herokuapp.com', // change here the herokuapp name port: 443 })

SinisterSpatula commented 2 years ago

@luismen97 that code goes into your client side app where you want to establish the connection to your server. If you're serving a web page to your client you would put that into the javascript file as part of that web page. You might need to review the documentation for peerjs if still not understanding. For my own use-case its for a chrome extension and I put that code into the background script of my chrome extension.

timotheeg commented 2 years ago

PD: Expect maybe a couple of days of downtime, as I want to take advantage of the issue to move the servers to the new maintaner's preferred location.

Hi there 👋 , so any update as to when 0.peerjs.com might be back?

jsProj commented 2 years ago

I have an alternative to 0.peer.js,

const serverOptions = {
    host: "peerturn.herokuapp.com",
    path: "/",
    port: 443,
    secure: true,
};

I use this for my client and server, whereas my server has a permanent ID where the client connects to.

timotheeg commented 2 years ago

That works! Thanks @jsProj 🙏

My project is very very light, so I don't expect to create much load onto your server at all, and I will shift to the official server when it is back up.

jonasgloning commented 2 years ago

Hi there 👋 , so any update as to when 0.peerjs.com might be back?

Edit: It’s up since last monday.