peerjs-server
peerjs-server copied to clipboard
Peerjs server deployed on heroku is not working
I used the deploy on Heroku button from this link to deploy a peerjs server. To connect to this server I used
const peer = new Peer(host: 'focusmonk-beta.herokuapp.com', port:9000, path:'/')
But this is not working, am I missing something ?
That's because the default password is wrong. Trying to find a fix
Any update on this, its saying connected but not receiving connection on two peers ? @vishalveerareddy @Chhinna
you need to use the port 443 I had the same issue. But I encountered another one :(. Due to security issues I cannot send my getUserMedia stream over the peer js connection.
I'm facing a similar issue. Is there any fix for this or not?
The request for https://<server-name>.herokuapp.com:9000/peer-server/peerjs/id?ts=16312062773910.47823913209901503
is failing due to CORS request did not succeed error.
How to fix this?
I'm facing a similar issue. Is there any fix for this or not? The request for
https://<server-name>.herokuapp.com:9000/peer-server/peerjs/id?ts=16312062773910.47823913209901503
is failing due to CORS request did not succeed error. How to fix this?
As Amine said above, you need to set 433 port in your url when you use https connection, or 80 port for http. This is default TCP ports.
I'm facing a similar issue. Is there any fix for this or not? The request for
https://<server-name>.herokuapp.com:9000/peer-server/peerjs/id?ts=16312062773910.47823913209901503
is failing due to CORS request did not succeed error. How to fix this?As Amine said above, you need to set 433 port in your url when you use https connection, or 80 port for http. This is default TCP ports.
Yeah, we need to use port 443, otherwise, it won't work. I ended up using the 0.peerjs.com peer cloud server which runs on port 443 instead of creating my own peer server.
I am getting this error, GET https://https//realtime-notepad-voice.herokuapp.com/:433/peerjs/peerjs/id?ts=16351849542150.5264754979506276 net::ERR_NAME_NOT_RESOLVED.
I have set the port to 433 still i am getting this error. It works fine on local host, but when i deploy on heroku i get this error. I also found this in the headers. Referrer Policy: strict-origin-when-cross-origin
@zaidm124 I have solved this issue using peer cloud instead of my own peer server. peer cloud server: https://0.peerjs.com. I think you actually can't set reserved ports, and Heroku assigns random ports. If you still want to make your own peer server, you need to use Nginx to use reserved ports as far as I have heard while I encountered this issue.
I am getting this error, GET https://https//realtime-notepad-voice.herokuapp.com/:433/peerjs/peerjs/id?ts=16351849542150.5264754979506276 net::ERR_NAME_NOT_RESOLVED.
I have set the port to 433 still i am getting this error. It works fine on local host, but when i deploy on heroku i get this error. I also found this in the headers. Referrer Policy: strict-origin-when-cross-origin
Have you seen your request url? It's completely broken
There should be https://realtime-notepad-voice.herokuapp.com:433/peerjs...
, but you have https://https//realtime-notepad-voice.herokuapp.com/:433/peerjs/
I am getting this error, GET https://https//realtime-notepad-voice.herokuapp.com/:433/peerjs/peerjs/id?ts=16351849542150.5264754979506276 net::ERR_NAME_NOT_RESOLVED. I have set the port to 433 still i am getting this error. It works fine on local host, but when i deploy on heroku i get this error. I also found this in the headers. Referrer Policy: strict-origin-when-cross-origin
Have you seen your request url? It's completely broken There should be
https://realtime-notepad-voice.herokuapp.com:433/peerjs...
, but you havehttps://https//realtime-notepad-voice.herokuapp.com/:433/peerjs/
but i have copied that url from the console, i dont think i can correct that
I am getting this error, GET https://https//realtime-notepad-voice.herokuapp.com/:433/peerjs/peerjs/id?ts=16351849542150.5264754979506276 net::ERR_NAME_NOT_RESOLVED.
I have set the port to 433 still i am getting this error. It works fine on local host, but when i deploy on heroku i get this error. I also found this in the headers. Referrer Policy: strict-origin-when-cross-origin
Here is the frontend code for using peer cloud server.
import Peer from "peerjs";
const myPeer = new Peer(undefined, {
key: "peerjs",
debug: 2,
secure: process.env.REACT_APP_ENV === "PRODUCTION" ? true : false, // secure : false for http connection
});
you can refer more in the docs https://peerjs.com/docs.html#start
@zaidm124 Can you share how do you connect to peerjs on the client side?
My configuration for custom peerjs server on heroku:
server (part of my express app):
const peerServer = ExpressPeerServer(httpServer)
expressApp.use('/peerjs', peerServer)
client:
new Peer(userInfo.uid, {
path: '/peerjs',
host: '/',
port: '433', // 433 for https, 80 for http
})
@zaidm124 Can you share how do you connect to peerjs on the client side?
My configuration for custom peerjs server on heroku:
server (part of my express app):
const peerServer = ExpressPeerServer(httpServer) expressApp.use('/peerjs', peerServer)
client:
new Peer(userInfo.uid, { path: '/peerjs', host: '/', port: '433', // 433 for https, 80 for http })
let peer = new Peer(undefined, { path: '/peerjs', secure: true, host: 'https://realtime-notepad-voice.herokuapp.com/', port: '433', });
This is what i did
This may be helpful : #9 for someone
Thank you so much everyone, the problem is solved for me now. Peer cloud server worked. Thank you again @blyzniuk @siddharthmagadum16
I am getting this error, GET https://https//realtime-notepad-voice.herokuapp.com/:433/peerjs/peerjs/id?ts=16351849542150.5264754979506276 net::ERR_NAME_NOT_RESOLVED. I have set the port to 433 still i am getting this error. It works fine on local host, but when i deploy on heroku i get this error. I also found this in the headers. Referrer Policy: strict-origin-when-cross-origin
Here is the frontend code for using peer cloud server.
import Peer from "peerjs"; const myPeer = new Peer(undefined, { key: "peerjs", debug: 2, secure: process.env.REACT_APP_ENV === "PRODUCTION" ? true : false, // secure : false for http connection });
you can refer more in the docs https://peerjs.com/docs.html#start
This worked for me, thank you so much for helping me out.