flutter-webrtc / flutter-webrtc-demo

Demo for flutter-webrtc
MIT License
1.15k stars 415 forks source link

Video Call Works on Wifi, But Not On 3G / 4G #115

Open donaldking opened 3 years ago

donaldking commented 3 years ago

I've noticed that the flutter-webrtc works on Wifi when both devices are on the same network but it doesn't connect when the devices are on Cellular network - 3G/4G. we've installed our own TURN server (Coturn) and tested the connection on https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/ which shows all is working fine (Including relay). Any ideas what could be the problem? or a possible solution? all we get from the flutter-webrtc package log is D/FlutterWebRTCPlugin(28968): onConnectionChangeFAILED Package version flutter_webrtc: ^0.5.7

2217263633 commented 3 years ago

I meet program and you seem!!

arttobe commented 3 years ago

I have the same Problem

DVendy commented 3 years ago

Any updates on this?

chhota89 commented 3 years ago

Any solution for this?

myusuf17 commented 3 years ago

still waiting solution for this because i try using mobile data connection and connect to demo.cloudwebrtc.com got same problem too

DVendy commented 3 years ago

Ok found out the solution. Turned out, the turn server is not properly configured for outside connection. It will only work for devices within the same network. To get this to work :

myusuf17 commented 3 years ago

i already install coturn but i get problem when start service rtc server : Failed to create TURN server listener: listen udp4 0.0.0.0:3478: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted

can you share sample additional setting config/config.ini and pkg/turn/turn.go .

myusuf17 commented 3 years ago

finally i got fixed this problem , you dont need install another turn server because when you start command go run main.go, automatically he created 2 service

  1. 8086 (for access web)
  2. 19302 (for turn server)

i solved this problem because i fix my firewall router configuration make sure port 19302 (protocol : UDP) open and can be access after that you can test you're configuration

https://check-host.net/check-udp?host=<you're ip public>:19302

my setting => configs/config.ini

[turn] public_ip=<you're ip public> port=19302 realm=flutter-webrtc

maybe next i will try using domain but at least with ip already works i hope you guys worked too