I am new to WebRTC.
I was learned about the turn server.
The below thing is used to configure the turn server works on TCP for a webrtc application.
Forcing WebRTC media over TCP is not recommended, its just a fallback option for strict firewalls.
If you specify ?transport=tcp
in TURN urls, then WebRTC client will connect to TURN Server over TCP.
Clients will send STUN requests over TCP to allocate relay candidates (As far as i know, currently chrome/firefox only request UDP relay candidates).
To force strict TCP via TURN server:
?transport=tcp
iceTransportPolicy:"relay"
, so that all media will flow via TURNAfter exchanging the relay candidates(udp) between peerConnections, the media path will be as below
P1 <--TCP--> P1TURN <--UDP--> P2TURN <--TCP--> P2
If both P1TURN & P2TURN are always same, then you can choose TURN relay path as LAN/lo interface i.e. you will get UDP relay candidates with LAN/lo IP.
If you want to avoid UDP & two times TURN in the media path, you need to use some SFU/SVC like Jitsi(supports pseudo-SSL candidates)/Janus.
Then media path will be as below
P1 <--TCP--> SFU/MCU <--TCP--> P2