Of couse, if i keep one device on the local network, and set the other device on 4G network, it stops to work… …so I’m planning to deploy a coturn docker container soon.
Nevertheless, there is something I dont understand…
By default WebRTC will connect to any internal/external addresses as long as they are accessible.
When using STUN/TURN servers you are usually targeting external networking.
But as things go, a lot of networks tend to implement the use of a NAT.
Which then means you’d need a STUN/TURN server to accomplish a stable connection.
Thank you so much for your answer ! So actually, if both are on my local network, you mean that not even the STUN server is reached ? …sorry to confirm, just, i’m really new to this…
If both devices are on your local network and you don’t have any weird network setup/conditions then you can use WebRTC internally without the requirement of a STUN/TURN server.
It only becomes complex and unstable when trying to connect externally or if you have a bit of a restrictive network. For example, some wireless networks have client isolation enabled which means devices will only get internet access but can’t connect to each other.