Add TURN TCP transport#331
Open
gasperov wants to merge 4 commits intopaullouisageneau:masterfrom
Open
Conversation
aa5ef5e to
ff09a07
Compare
paullouisageneau
requested changes
Apr 17, 2026
Owner
paullouisageneau
left a comment
There was a problem hiding this comment.
This might kind of work, but there are a bunch of issues with the implementation.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
TCP TURN relay entries start in STANDBY when any UDP probe exists (STUN servers or UDP TURN). TCP activates only after all UDP probes have each retransmitted TURN_TCP_FALLBACK_RETRANSMISSIONS times without response, indicating UDP is globally blocked. If any UDP relay succeeds first, TCP is cancelled. - Add AGENT_STUN_ENTRY_STATE_STANDBY and is_tcp_fallback flag - Replace per-pair fallback_entry with global counter-based trigger (O(1) per probe, single O(n) activation scan when all probes report) - Add agent_conn_turn_tcp_state to handle TCP CONNECTED/FAILED callbacks and avoid log spam while waiting for TCP connection - Add juice_get_selected_relay_transport() public API - Expand test_turn_udp_preferred: two scenarios (STUN+TCP and STUN+UDP+TCP) verifying both SERVER and UDP RELAY entries participate in probe count Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Implement TURN relay over TCP (transport=TCP) as an alternative to the default UDP transport. This allows WebRTC connectivity in environments that block UDP entirely.