shama / letswritecode

:mortar_board: code examples for Let's Write Code
https://www.youtube.com/user/kylerobinsonyoung
804 stars 759 forks source link

won't connect when clients are not in the same network #86

Open omidshakeri opened 7 months ago

omidshakeri commented 7 months ago

simple-peer won't connect when clients are not in the same network

It works perfectly if both clients are in the same network (connected to the same modem/WiFi) but even after setting iceServers, the connection is not working

link to the sample html file: https://github.com/omidshakeri/simple-peer-videocall

this a simplified version, without any Server so you should copy textbox values to other device

URL for initaiator: https://omidtest.ir/VC/VideoCall.html#init

URL for other peer: https://omidtest.ir/VC/VideoCall.html

Steps:

  1. after a few seconds, "MyID" in initaiator peer page will be filled
  2. copy that to "ClinetID" textbox in other peer device and press "Connect"
  3. after a few seconds, "MyID" in other peer page will be filled
  4. copy that to "ClinetID" textbox in initaiator peer device and press "Connect"

TURN Server urls are from free plan of "metered.ca"