peers / peerjs-server

Server for PeerJS

Home Page:https://peerjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

diazlp opened this issue · comments

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

  • What I already tried:
  1. I tried to change port to either 80 or 443 but instead I got server 503 Bad Gateway
  2. I tried to run global peer-server but it also doesn't cut it
  3. I tried to run on the same port (22022) but yeah, it produces "Lost connection to server"

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

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

new Peer({ port: 9000, host: "mydomain" })

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

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