Skip to content

PROXY protocol support - #17

Merged
martynp merged 2 commits into
mainfrom
proxy_support
Jul 21, 2026
Merged

PROXY protocol support#17
martynp merged 2 commits into
mainfrom
proxy_support

Conversation

@martynp

@martynp martynp commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

More detail to follow.

Based on rwf2/Rocket#2997

@martynp
martynp marked this pull request as draft July 10, 2026 16:28
@martynp
martynp requested a review from Copilot July 10, 2026 16:28

Copilot AI 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.

Pull request overview

This PR adds optional PROXY protocol (v1/v2) support to the core listener stack, allowing Rocket to recover the original client address from a TCP-level preamble when running behind L4 proxies/load balancers (e.g., HAProxy TCP mode, AWS NLB), and documents/configures the feature across the project.

Changes:

  • Introduces a new ProxyProtocolListener (behind the proxy-proto crate feature) and wires it into DefaultListener (including TLS composition).
  • Adds a new proxy_protocol configuration key (env ROCKET_PROXY_PROTOCOL) plus user-facing docs and changelog entries.
  • Adds testbench coverage and enables the feature in CI/test scripts.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
website/docs/11-deploying.md Documents when/how to use PROXY protocol for client address recovery behind L4 proxies.
website/docs/10-configuration.md Adds proxy_protocol config option and a new “PROXY Protocol” configuration section.
testbench/src/servers/sni_resolver.rs Import reordering (no functional change).
testbench/src/servers/proxy_proto.rs Adds integration tests validating forwarded remote address + rejection behavior.
testbench/src/servers/mod.rs Registers the new proxy_proto test server module.
testbench/Cargo.toml Enables rkt’s proxy-proto feature for testbench builds.
scripts/test.sh Adds proxy-proto to the feature matrix exercised by tests.
core/lib/src/tls/listener.rs Adjusts TlsListener’s Accept/connect plumbing to compose with additional listener layers.
core/lib/src/listener/proxy.rs Implements PROXY protocol v1/v2 parsing + listener/stream wrapper (new).
core/lib/src/listener/mod.rs Exposes the new listener::proxy module behind the proxy-proto feature.
core/lib/src/listener/default.rs Wraps transport listeners with ProxyProtocolListener when compiled + adds config/error wiring.
core/lib/src/lib.rs Documents the new proxy-proto crate feature.
core/lib/Cargo.toml Declares the new proxy-proto feature flag.
CHANGELOG.md Adds an Unreleased entry describing PROXY protocol support and configuration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread website/docs/10-configuration.md Outdated
Comment thread website/docs/10-configuration.md Outdated
@martynp martynp added this to the v1.2.0 milestone Jul 12, 2026
AI-Tool: Claude Code

Copilot AI 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.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated no new comments.

@martynp
martynp marked this pull request as ready for review July 21, 2026 13:50
@martynp
martynp merged commit c8ed099 into main Jul 21, 2026
11 checks passed
@martynp
martynp deleted the proxy_support branch July 25, 2026 17:45
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.

2 participants