tcpwebrtcvoipsdpcoturn

TURN server webrtc tcp relay


I am using coturn as my TURN server for relay in a WebRTC connection. What I want to achieve is TCP based connection and not UDP.

What I have tried : In coturn configuration, I have set no-udp and no-udp-relay to force TCP based connection only.

# Uncomment if no UDP client listener is desired.
# By default UDP client listener is always started.
#
no-udp

# Uncomment if no UDP relay endpoints are allowed.
# By default UDP relay endpoints are enabled (like in RFC 5766).
#
no-udp-relay

Whenevere, I try to establish a connection, I get turn server may be broken.

Possibly useful detail, A and B are trying to communicate

The question is, what could be the reason for failure ?

Edit : Here is latest issue from Chromium page https://bugs.chromium.org/p/chromium/issues/detail?id=1201700#c5


Solution

  • Even if a TURN extension exists to obtain a TCP allocation, WebRTC does not support TURN TCP relaying, only UDP. However, it supports connecting the TURN server with TCP or TLS.

    This reason is that the TURN server is assumed to be on an unrestricted network with working UDP connectivity. Since TCP has bad properties for real-time traffic, it should only be a last resort fallback, and in the extreme situation where both peers lack UDP connectivity, they can connect to TURN servers with TCP, the traffic between the TURN servers will still be UDP.