i336_
i336_

Reputation: 2011

How can I easily test if a WebRTC request from my PC will use a TURN server or connect directly?

My grasp of how WebRTC works is a little flaky, but I understand that if my device is unable to create a direct connection with another peer (due to NAT, firewalling, etc), a TURN server will be used as a relay.

Is there a public service I can use to find out if my device is using a TURN server or connected directly to another peer?

Upvotes: 0

Views: 4371

Answers (1)

Zezinho Oliveira
Zezinho Oliveira

Reputation: 29

Are u talking about a native app? or web app?

For native app's the solution can be:

  • wireshark - easy to do easy to understand

For web app's u also can use the :

  • chrome://webrtc-internals/

If you have access to the code it self just change the links they will be something like this:

iceServers = {"stun://mystunserver.com","turn://myturnserver.com {user:**** ,password=****}"};

just remove the turn if you are able to make a call you are using stun.

take note that the servers are used in the order that they appear in the list so stun servers first turn after

i hope it helps

EDIT 1:

See this post i think this was the answer for you: How to check if WebRTC uses a relay server?

the only solution that i know is trying to connecto to a STUN server if it fails you are using TURN

For your second comment, yes you have that kind of statistics but they are released by companies that have their own STUN/TURN servers, like the company that i work, they should be something like ~85% of the times you use STUN (direct p2p) and ~15% you use STUN (relayed p2p).

i hope that your question is answered now any doubt just comment again i will be happy to help you

Upvotes: 2

Related Questions