Skip to content

Prefer moq-lite ALPNs over H3 and simplify iroh scheme#960

Merged
kixelated merged 5 commits intomainfrom
iroh-alpn
Feb 14, 2026
Merged

Prefer moq-lite ALPNs over H3 and simplify iroh scheme#960
kixelated merged 5 commits intomainfrom
iroh-alpn

Conversation

@kixelated
Copy link
Collaborator

Summary

  • Advertise moq-lite ALPNs before H3 across all backends (quinn, quiche, iroh) since H3 requires WebTransport framing which not all H3 endpoints support
  • Remove moql+iroh, moqt+iroh, moqt-15+iroh, h3+iroh URL schemes — only iroh is supported now
  • Bump moq-native to 0.12.3

Test plan

  • Verify native-to-native connections negotiate a moq-lite ALPN
  • Verify browser (WebTransport/H3) connections still work as fallback
  • Verify iroh:// URLs connect successfully

🤖 Generated with Claude Code

kixelated and others added 3 commits February 13, 2026 15:00
H3 requires WebTransport framing which not all H3 endpoints support,
so advertise it last. Also remove the +iroh scheme variants (moql+iroh,
moqt+iroh, etc.) in favor of just "iroh".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 13, 2026

Walkthrough

Workspace manifest updated: web-transport-iroh bumped to 0.2 and web-transport-proto added at 0.5. Package rs/moq-native bumped 0.13.0 → 0.13.1; its iroh feature now depends on web-transport-proto. Iroh internals reworked: IrohRequest::Quic now holds web_transport_iroh::QuicRequest; IROH_SCHEMES and is_iroh_url removed; client URL detection now uses url.scheme() == "iroh"; ConnectRequest/ConnectResponse from web_transport_proto imported. ALPN ordering changed to collect moq_lite ALPNS first and append h3 last across connect and server code.

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: prioritizing moq-lite ALPNs over H3 and simplifying the iroh URL scheme from multiple variants to just 'iroh'.
Description check ✅ Passed The description is directly related to the changeset, explaining the rationale for ALPN reordering and URL scheme simplification, with specific test verification steps.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch iroh-alpn

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

# Conflicts:
#	Cargo.lock
#	rs/moq-native/Cargo.toml
@kixelated kixelated enabled auto-merge (squash) February 13, 2026 23:47
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@rs/moq-native/src/iroh.rs`:
- Around line 72-82: Add unit tests covering the bind() method, the connect()
function, and the url_set_scheme() utility: write tests that validate ALPN
ordering remains moq-lite entries before web_transport_iroh::ALPN_H3, that
bind() correctly binds or returns errors for v4/v6 addresses, that connect()
establishes (or errors) under expected conditions, and that url_set_scheme()
updates URL schemes correctly for typical inputs; place tests in the module's
tests section or a #[cfg(test)] mod with targeted cases exercising normal, edge,
and error paths and referencing the functions bind(), connect(), and
url_set_scheme() so CI verifies behavior.
🧹 Nitpick comments (1)
rs/moq-native/src/iroh.rs (1)

159-167: Inconsistent H3 ALPN: hardcoded b"h3" vs. web_transport_iroh::ALPN_H3.

Line 74 and line 174 use the web_transport_iroh::ALPN_H3 constant, but line 166 hardcodes b"h3". Use the constant for consistency to avoid a silent mismatch if the value ever changes.

Suggested fix
-	additional.push(b"h3".to_vec());
+	additional.push(web_transport_iroh::ALPN_H3.as_bytes().to_vec());

Comment on lines +72 to 82
// H3 is last because it requires WebTransport framing which not all H3 endpoints support.
let mut alpns: Vec<Vec<u8>> = moq_lite::ALPNS.iter().map(|alpn| alpn.as_bytes().to_vec()).collect();
alpns.push(web_transport_iroh::ALPN_H3.as_bytes().to_vec());

let mut builder = IrohEndpoint::builder().secret_key(secret_key).alpns(alpns);
if let Some(addr) = self.bind_v4 {
builder = builder.bind_addr_v4(addr);
builder = builder.bind_addr(addr)?;
}
if let Some(addr) = self.bind_v6 {
builder = builder.bind_addr_v6(addr);
builder = builder.bind_addr(addr)?;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if bind_addr is used elsewhere and what type it returns
rg -n 'bind_addr' --type=rust -C3

Repository: moq-dev/moq

Length of output: 627


🏁 Script executed:

#!/bin/bash
# Get more context around the lines in question and check the full file
head -100 rs/moq-native/src/iroh.rs | tail -40

Repository: moq-dev/moq

Length of output: 1132


🏁 Script executed:

#!/bin/bash
# Check for other backends to compare ALPN patterns
rg -n 'ALPN' --type=rust -C2 | head -60

Repository: moq-dev/moq

Length of output: 3931


🏁 Script executed:

#!/bin/bash
# Check for tests in the iroh.rs file
rg -n '#\[test\]|#\[cfg\(test\)\]|mod tests' rs/moq-native/src/iroh.rs

Repository: moq-dev/moq

Length of output: 37


🏁 Script executed:

#!/bin/bash
# Get the full file to understand its structure
wc -l rs/moq-native/src/iroh.rs

Repository: moq-dev/moq

Length of output: 84


🏁 Script executed:

#!/bin/bash
# Read the full file to assess structure and test integration
cat -n rs/moq-native/src/iroh.rs

Repository: moq-dev/moq

Length of output: 8442


ALPN ordering and binding are correct, but tests are missing per Rust file guidelines.

The ALPN priority (moq-lite first, H3 last) is correct and consistently applied throughout the file. The builder.bind_addr(addr)? calls correctly handle the fallible API by propagating errors.

However, this Rust file lacks integrated tests. The bind() method, connect() function, and url_set_scheme() utility should have unit tests.

🤖 Prompt for AI Agents
In `@rs/moq-native/src/iroh.rs` around lines 72 - 82, Add unit tests covering the
bind() method, the connect() function, and the url_set_scheme() utility: write
tests that validate ALPN ordering remains moq-lite entries before
web_transport_iroh::ALPN_H3, that bind() correctly binds or returns errors for
v4/v6 addresses, that connect() establishes (or errors) under expected
conditions, and that url_set_scheme() updates URL schemes correctly for typical
inputs; place tests in the module's tests section or a #[cfg(test)] mod with
targeted cases exercising normal, edge, and error paths and referencing the
functions bind(), connect(), and url_set_scheme() so CI verifies behavior.

@kixelated kixelated merged commit c35f406 into main Feb 14, 2026
1 check passed
@kixelated kixelated deleted the iroh-alpn branch February 14, 2026 00:16
@moq-bot moq-bot bot mentioned this pull request Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant