-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add API to force Janus to use TURN #2774
Conversation
I can confirm this works... Pass in
|
Just added a config property to allow/prevent this new functionality to be used in the Janus API: the default is |
All good with these new changes Upped my logging to verbose
|
Thanks for the feedback! I'll merge then 👍 |
@lminiero @danjenkins hi guys, can anyone please tell me how to configure janus js in such case? |
It's explained in the first post. |
If you need further support please use the mailing list where many users can help you. Lorenzo is trying to be on holiday... |
yeah, got it |
In case you configured Janus to use a TURN server (which you almost always will NOT want to do!), you may also sometimes want to actually force Janus to use TURN: this is what this patch allows you to do, and can be considered the Janus equivalent of the
iceTransportPolicy:"relay"
you can use in browsers, to force them to use TURN instead. Enabling it is very easy, since all you need to do is add aforce_relay:true
attribute to the JSEP object you send to Janus, whether it's an offer or answer.Notice this only works for libnice >= 0.1.14, as that's the version the property we use was added to. Besides, notice that this WILL cause PeerConnections to fail if: a. you didn't set any TURN server in Janus, b. Janus couldn't get a relay candidate from that server, or c. that candidate can't talk to the peer for any reason.
VERY IMPORTANT: Notice that you should NOT use this if you want USERS connected to Janus to use TURN. For USERS, you use
iceTransportPolicy:"relay"
on the client side: Janus will automatically talk to the TURN server, and does NOT need to be configured with TURN support itself. Janus ONLY needs TURN support in very specific cases, like when Janus itself is deployed behind a restrictive firewall (e.g., Janus acting as an endpoint in your home), and that's the ONLY time you'll need to actually be aware ths new feature exists.I wrote this in all caps multiple times as it is a VERY common thing people get wrong all the time (main reason why we have a FAQ item for that), so I pretty much felt I had to repeat it all over again 😜