peerjs: Unable to connect
Getting error https://0.peerjs.com/peerjs/id?ts=15938580580230.27749202685512375 net::ERR_CONNECTION_TIMED_OUT since the latest update.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 13
- Comments: 24 (3 by maintainers)
Fix cloud server please, I’m having a final project at the moment. I must finished it before tomorrow.
I have found a solution for a similar kind of problem. Actually, the peer server runs on HTTP protocol, and for making it run on HTTPS protocol, we need to generate an SSL key and certificate. Even after generating these things, it will only run on the localhost server and the systems connected to that network.
There is a peer server hosted on a Heroku, so it is running on HTTPS, rather than using your own peer server, we can use the path of the Heroku peer server and then host the app on some hosting website, The app will run properly. I had solved my problem with this. peer = new Peer({host:‘peerjs-server.herokuapp.com’, secure:true, port:443})
the map file was fixed in 1.3.1
Hi, I’ve done what you did and now the client can initialize a new Peer with an ID. However, when I try to connect two Peers together, the Peer client who is trying to connect trigger an error like that :
ERROR PeerJS: Error: Could not connect to peer 377b4bb0-3101-4af0-9203-f85210I’ve tried many time with differents browsers but always the same result, it’s impossible to connect two Peers together.
Also, the Peer client who is waiting for a connection don’t trigger any messages or errors in the console (I have activated
debug : 3in the Peer parameters)Seems to work on gitpod although a bit unintuitive …
Note path (/), port (443), secure (to enable https rather than http).
Also: You can get URL from the gitpod “preview” window - you will see port number there (443 in my case). You can see see logs in gitpod terminal. You can also start server in terminal -> npm start
You can go this link https://github.com/peers/peerjs-server, click on ‘Open on Gitpod’ and start your own new peer-server. With those config
new Peer([id], { host: [your-host-name], port: 443, secure: true })Until now my server can connect but send message got some error. Maybe you can try and help me solve it.