peers / peerjs-server

Server for PeerJS
https://peerjs.com
MIT License
4.38k stars 1.09k forks source link

Peer connection from client from pre-defined url port [NGINX] #285

Closed diazlp closed 2 years ago

diazlp commented 2 years ago

Hi, so I've been successfully connected peerjs to peer-server from my React frontend to Nestjs backend on localhost

the problem is when I try to deploy it, my website already has this pre-defined port and it seems that it only causing unwanted errors

here's my website url: https://mydomain:22022

and when I try to connect to it on deployment (I use port 9000 on peer-server), here's what I got instead: https://mydomain:22022:9000 which produces silly infinite data fetching

If any of you guys can help, big thanks in advance!

jonasgloning commented 2 years ago

Hey @diazlp, did you include your port in the host parameter? If yes, just remove it. Try:

new Peer({ port: 9000, host: "mydomain" })
diazlp commented 2 years ago

I did. Yes, I already tried removing the port from the host parameter and apparently, https://mydomain:9000 leads me to nowhere.

Or probably thats because I haven't registered my DNS with port 9000.

Anyway, thank you for answering :D

lukadriel7 commented 1 year ago

@diazlp hello, can you please share how you integrated peer with nestjs? I can't seem to get it to work