WebRTC-iOS icon indicating copy to clipboard operation
WebRTC-iOS copied to clipboard

Problem with external network

Open SteffvGils opened this issue 5 years ago • 4 comments

Hello all,

For a project we set-up a fully functional WebRTC connection between multiple browsers (on PC) and on Android. Locally as wel as globally.

But when we tried to do the same for iOS we encountered the problem that we could only start a connection via Safari that was able to connect over a public IP. In our case we want to do this from within an app, for this we used a webview within the app but this "browser" was not able to setup any WebRTC connection at all. Thus we decided to use a native libary from this Github post ;)

We changed what had to be done and built it into our existing app to make this communicate with our own signalling server and other parts of the app.

The thing with this is, that it does only allow us to setup a local connection but when we try it over an public IP nothing seems to happen. An "offer" is send but no candidate-packages. Is there a way we can easily debug the issue? Or is this problem known to anyone?

Preferable we do not want to use an TURN-server since these are bulky and can be expensive. Thereby, the connection does work on Safari itself and all the other non-apple-browers? So is a TURN server required?

I hope anyone can help me with this problem.

Kind regards,

SteffvGils avatar Nov 12 '20 11:11 SteffvGils

Hey, I'm not a VOiP expert but from my experience most of the time, p2p connections is not possible due to NAT, firewalls or other complex networks who prevent that. In those cases, a TURN server is required to relay all the traffic between two peers who cannot directly reach each other.

stasel avatar Nov 12 '20 12:11 stasel

Hey Stasel, thanx for the quick resposne! The strange thing is that it works in Safari, without a turn server, on extern networks.

The WKWebview in Swift wont support WebRTC. For that reason we use youre libary. But it would be strange if a turn server is required in your libary, but not in safari on the same device.

That shouldn't matter for the connection, right?

By the way, it is absolutely no reproach or comment, but it would be nice if we could get this working without a costly turn server ;)

Regards, Steff van Gils

SteffvGils avatar Nov 12 '20 12:11 SteffvGils

Hi stasel, is there perhaps an opportunity to contact you personally regarding the above? It may not be customary, but since it is a fairly specific question, it may be a bit easier.

SteffvGils avatar Apr 21 '21 13:04 SteffvGils

@stasel: i am having similar issues. If i create a config with all the appropriate iceServers (both stun/turn) and then create a peerConnection with the same config. then everything works fine. however, adding iceServers to a new config and resetting the config in the same peerConnection does not seem to be generating new ice candidates. i tried calling restartIce() on peerConnection and that did not help either.

any ideas/suggestions? would really appreciate it. thank you! similar logic using an android library works fine on my android client - which is weird.

balusu-murali avatar Nov 15 '21 22:11 balusu-murali