How can I know if the relayProtocol used by my local relay candidate is tcp or udp?

68 Views Asked by At

Whether it's js for browser or android sdk, I can't seem to find an exact property indicating whether the candidate is connecting to turn via udp or tcp.

1

There are 1 best solutions below

4
Christian Fritz On

Open about://webrtc-internals/ and open the tab for your connection. Then under local-candidate check the protocol, e.g.:

local-candidate (candidateType=relay, relayProtocol=udp, id=I3MLk9CWG)
  Statistics I3MLk9CWG
  timestamp 6/7/2023, 7:52:44 AM
  transportId   Tvideo01
  isRemote  false
  networkType   unknown
  ip    54.184.68.133
  address   54.184.68.133
  port  34581
  protocol  udp
  relayProtocol udp   // <---
  candidateType relay
  priority  33562623
  url   turn:transitiverobotics.com:3478?transport=udp
  foundation    4225971487
  usernameFragment  TGiw
  vpn*  false
  networkAdapterType*   any

Updated: showing a case with relayProtocol present


To get programmatic access to this, use https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/getStats.