Skip to content

fix(relay): expose accepted HTTP peers through ConnectInfo - #6430

Merged
kixelated merged 3 commits into
mainfrom
codex/http-peer-address
Oct 23, 2026
Merged

kixelated merged 3 commits into
mainfrom
codex/http-peer-address

Conversation

@kixelated

@kixelated kixelated commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Embedded HTTP routes cannot extract the accepted socket address: the web server stores Axum ConnectInfo with a private listener type. Authentication and abuse controls in embedded routes need the actual transport peer rather than forwarding headers.

Approach

Expose Axum's standard ConnectInfo<SocketAddr> on both web listeners. Convert the private listener address when building the service and keep built-in HTTP and WebSocket authentication using the same accepted address. A real HTTP regression verifies the extracted peer matches the client's socket despite a forged forwarding header.

Impact

  • Public API: additive. Embedded routes can use ConnectInfo<SocketAddr> without a relay-specific public type; no MIGRATE.md entry needed.
  • No wire, CLI, or configuration changes.

Alternatives

Publishing the listener wrapper or adding another peer extension would expose an extra type for information Axum already represents.

Decision taken

The CLI stats failure (moq-cli::integration stats::a_late_sink_reads_the_final_stats) is not caused by this PR: that test connects over QUIC and never touches the HTTP ConnectInfo path. On a fresh merge of main (after moq-dev/moq#6290) it passes, so nothing further is owed here.

Validation

  • Merged origin/main cleanly; quest check passes.
  • The new embedded-route regression failed before the fix with HTTP 500.
  • moq-cli stats integration suite: 4/4 pass on the merged head.
  • just check: all lint and test modules pass (582 + 226 Rust tests).

Follow-ups

No design follow-up identified for peer extraction.

(Written by Claude Opus 5.5)

Co-Authored-By: GPT-6 <noreply@openai.com>
@kixelated

Copy link
Copy Markdown
Collaborator Author

The peer seam is checkpointed at 375c55a21, with all 42 focused web/WebSocket tests passing on its clean committed head.

The full CI failure has a concrete test-isolation lead: stats::a_late_sink_reads_the_final_stats waits for the INFO-level “input ended” message, but its child command clears MOQ_* variables without setting RUST_LOG; this environment supplies RUST_LOG=warn. That suppresses the synchronization message and produces the observed exit-before-input-ended assertion. Recommend fixing the test's logging contract independently. No environment workaround or rerun to green was used here, and full CI remains failed.

(Written by GPT-6)

@kixelated
kixelated marked this pull request as ready for review October 23, 2026 08:12
@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 7 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bd76b69e-8901-4262-b226-e52ad6451450
📥 Commits

Reviewing files that changed from the base of the PR and between 69b0538 and 3eed9c7.

📒 Files selected for processing: 4
  • doc/bin/relay/index.md
  • rs/moq-relay/src/listener.rs
  • rs/moq-relay/src/web.rs
  • rs/moq-relay/src/websocket.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-23T09:09:17.537387Z 3eed9c7 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ee06c31018

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread rs/moq-relay/src/web.rs Resolved
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated

Copy link
Copy Markdown
Collaborator Author

@codex review

(Written by Claude Opus 5.5)

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 3eed9c7506

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@kixelated
kixelated added this pull request to the merge queue Oct 23, 2026
Merged via the queue into main with commit a604a0b Oct 23, 2026
9 checks passed
@kixelated
kixelated deleted the codex/http-peer-address branch October 23, 2026 15:55
kixelated added a commit that referenced this pull request Oct 30, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
moq-bot Bot pushed a commit that referenced this pull request Oct 31, 2026
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: moq-bot <moq-bot@users.noreply.github.com>
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