Skip to content

(2.12) Add opt-in support for the PROXY protocol#7456

Merged
neilalexander merged 2 commits intomainfrom
byron/proxy-protocol
Nov 11, 2025
Merged

(2.12) Add opt-in support for the PROXY protocol#7456
neilalexander merged 2 commits intomainfrom
byron/proxy-protocol

Conversation

@bruth
Copy link
Copy Markdown
Member

@bruth bruth commented Oct 21, 2025

The use case is to allow for transparent mapping of the source IP to the server for monitoring, auth callout, etc. See https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt

Note, this was largely Claude generated since the spec is well defined.

Signed-off-by: Byron Ruth byron@nats.io

@bruth bruth force-pushed the byron/proxy-protocol branch 2 times, most recently from 35ffb4a to f1760c6 Compare October 23, 2025 11:42
@neilalexander neilalexander force-pushed the byron/proxy-protocol branch 6 times, most recently from 3611fff to 8e1c8d9 Compare November 3, 2025 17:11
@neilalexander neilalexander marked this pull request as ready for review November 3, 2025 17:34
@neilalexander neilalexander requested a review from a team as a code owner November 3, 2025 17:34
opts.Port = -1 // Random port
opts.ProxyProtocol = true
opts.Port = -1
opts.ProxiedPort = -1
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not a fan of this approach IMO. But I understand why we ended up here.

If we say proxy has to be TLS first enabled, would that resolve?

@neilalexander neilalexander force-pushed the byron/proxy-protocol branch 2 times, most recently from 99a0d7f to 53f3d43 Compare November 11, 2025 11:35
@neilalexander neilalexander force-pushed the byron/proxy-protocol branch 2 times, most recently from 0b9a8ad to fdd0d7e Compare November 11, 2025 15:37
Copy link
Copy Markdown
Member

@kozlovic kozlovic left a comment

Choose a reason for hiding this comment

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

Just a little update needed since we don't have to strip the CRLF anymore, and a comment about the v2 header that at least could be consumed as a 10 bytes (since it is 16 but we read the first 6 bytes) instead of reading 6+4. But ok if leaving the way it is.

bruth and others added 2 commits November 11, 2025 16:51
Signed-off-by: Byron Ruth <byron@nats.io>
Copy link
Copy Markdown
Member

@kozlovic kozlovic left a comment

Choose a reason for hiding this comment

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

LGTM

@neilalexander neilalexander changed the title Add opt-in support for the PROXY protocol (2.12) Add opt-in support for the PROXY protocol Nov 11, 2025
@neilalexander neilalexander merged commit ed493ec into main Nov 11, 2025
111 of 114 checks passed
@neilalexander neilalexander deleted the byron/proxy-protocol branch November 11, 2025 20:10
neilalexander added a commit that referenced this pull request Nov 12, 2025
Includes the following:

- #7534
- #7535
- #7536
- #7537
- #7538
- #7539
- #7543
- #7456

Signed-off-by: Neil Twigg <neil@nats.io>
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.

4 participants