feat: add TCP ICE candidate support (RFC 6544)#2085
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add TCP ICE candidate (RFC 6544) support so that WebRTC clients can connect over TCP when UDP is unavailable or restricted.
Motivation
Some network environments block UDP traffic. TCP ICE candidates allow WebRTC sessions to fall back to TCP without requiring a TURN relay, reducing latency and infrastructure cost compared to relay.
Backward Compatibility
The existing OvenPlayer has
IceTransportPolicy: 'relay'configured. This means the moment iceServers are delivered to the player, the browser exclusively uses TURN relay and ignores all direct candidates. This behavior is the foundation of the compatibility design.Default behavior (
TcpRelayForce=false,DefaultTransport=udptcp):IceTransportPolicy=relayhas no effect since no iceServers are provided. Connects via direct candidates normally.TcpRelayForce=true:IceTransportPolicy=relaykicks in, uses relay only.?transport=all:IceTransportPolicy=relaykicks in, uses relay only. Same behavior as before.IceTransportPolicy=all): all three candidates available, browser picks by priority (UDP > TCP > relay). Maximum compatibility.Configuration Changes
New
<IceCandidates>fields:<TcpForce>is preserved as a deprecated alias for<TcpRelayForce>.Transport Policy (
?transport)<DefaultTransport>(default: udptcp)TcpRelayForce(default: false)udptcprelayudptcpallKnown limitations
Work in progress. Testing ongoing.