flutter-webrtc-demo icon indicating copy to clipboard operation
flutter-webrtc-demo copied to clipboard

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

Open donaldking opened this issue 5 years ago • 9 comments

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

donaldking avatar Dec 30 '20 17:12 donaldking

I meet program and you seem!!

2217263633 avatar Jan 05 '21 09:01 2217263633

I have the same Problem

arttobe avatar Feb 22 '21 11:02 arttobe

Any updates on this?

DVendy avatar Apr 06 '21 04:04 DVendy

Any solution for this?

chhota89 avatar Apr 19 '21 12:04 chhota89

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

myusuf17 avatar Apr 29 '21 05:04 myusuf17

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 :

  • create your own turn server, I'm using coturn
  • configure the turn server in config/config.ini and pkg/turn/turn.go with your turn server config (IP, port, realm, username, password, etc)

DVendy avatar Apr 30 '21 06:04 DVendy

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 avatar May 03 '21 00:05 myusuf17

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

myusuf17 avatar May 17 '21 07:05 myusuf17