feat: replace custom webtransport with upstream webtransport-go#6
Open
feat: replace custom webtransport with upstream webtransport-go#6
Conversation
Replace the custom webtransport/ package (a draft-02-only fork) with github.com/quic-go/webtransport-go v0.10.0, which supports Application Protocol Negotiation (draft-14+). This enables CA-signed cert connections in production while preserving self-signed cert support for local dev. - Upgrade quic-go v0.50.0 → v0.59.0, add webtransport-go v0.10.0 - Delete 8-file custom webtransport/ package - Update distribution/ callers: concrete pointer types replace interfaces - Narrow control stream to io.ReadWriter for testability - Simplify test mock from 9 methods to 2 - Configure HTTP/3 server with ALPN and WebTransport settings
Replace Cubic (loss-based) with BBRv3 (delay-based) congestion control for QUIC/WebTransport media delivery. BBRv3 detects queueing early and smooths delivery rate, eliminating the burst-starve pattern that caused 400-480ms jitter spikes with Cubic over internet paths. Fork: github.com/zsiec/quic-go v0.59.1-bbr Spec: IETF draft-ietf-ccwg-bbr-04 (BBRv3, Oct 2025)
Enables downstream applications to accept additional bidirectional WebTransport streams beyond the MoQ control stream. Each accepted stream is dispatched to the callback in its own goroutine. Follows the established OnDatagram pattern: callback field on ServerConfig, threaded through MoQSessionConfig, accept loop spawned alongside readControlLoop and readDatagramLoop in Run().
Allow applications to react when a MoQ viewer is added to a relay, enabling use cases like forcing IDR keyframes for immediate decodability.
The quic-go defaults (512KB stream / 768KB connection initial flow control windows) are too small for live video streaming. At 3Mbps a single preview stream exhausts the window in ~2s, causing SendStream.Write to block and triggering server-side frame drops. Callers can now pass a custom *quic.Config via ServerConfig.QUICConfig to set appropriate InitialStreamReceiveWindow, InitialConnectionReceiveWindow, and max window sizes.
Log warnings when OpenUniStreamSync or WriteVideoFrame take >50ms. Log when keyframes are dropped due to channel full (with queue depth). This identifies whether QUIC stream creation or frame writes are the bottleneck causing frame drops in the MoQ relay.
Change OnDatagram callback type from func(streamKey, data) to func(streamKey, data) []byte. Non-nil return is sent back to the originating session via SendDatagram. Enables ping/pong clock sync.
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
Brief description of the change.
Test Plan
make checkpasses