Closed mlichvar closed 1 year ago
Hello @mlichvar,
The STUN
server is mandatory
and can't be unset, which is why I put it forcing, in case someone doesn't set it at all. While the TURN is highly recommended, in case direct connection between peers is not possible, here You are right, as TURN
is not mandatory, I made it optional
in the last commit.
The STUN/TURN are configurable in the .env as well, but STUN
must be set, if not, it use a google default one: stun:stun.l.google.com:19302
. Without it, the signaling server
, not knowing the peers IPs, is not able to connect them to each other.
You can install your own, following this doc I made.
This is the MiroTalk C2C logic.
For any doubts or questions, Join with us on forum, where you can also find many answers. Thank you!
Well, it works for me with empty iceServers. This answer explains that it should use just the local addresses when no STUN/TURN is specified: https://stackoverflow.com/questions/32301119/is-ice-necessary-for-client-server-webrtc-applications
I could run coturn on my router, but it doesn't seem to be useful in my case.
If you use it internally
to your network
, you probably don't need the STUN either. Ok I'll make that optional too.
Thanks!
You are welcome! You can keep the Stun/Turn credentials and just enable or disable it, I added also two new params for that:
STUN_SERVER_ENABLED=false # true or false
TURN_SERVER_ENABLED=false # true or false
So, depending on the case, anyone can enable them or not ;)
If my clients can connect directly to each other and I want to avoid using STUN/TURN servers, it seems iceServers needs to be set to an empty array. It would be nice if that was possible just by editing the
.env
file and not the source code. Currently it's hardcoded to contain a STUN and TURN server.