Skip to content

Conversation

@antondalgren
Copy link
Contributor

WHAT is this pull request doing?

Remove the tcp_proxy_protocol and unix_proxy_protocol config options. Instead, automatically detect proxy protocol by peeking at the first bytes of incoming connections:

  • V1: starts with "PROXY " text
  • V2: starts with 12-byte binary signature

This simplifies configuration and allows mixed V1/V2 connections without requiring users to know which version their load balancer uses.

HOW can this pull request be tested?

Specs

Remove the tcp_proxy_protocol and unix_proxy_protocol config options.
Instead, automatically detect proxy protocol by peeking at the first
bytes of incoming connections:
- V1: starts with "PROXY " text
- V2: starts with 12-byte binary signature

This simplifies configuration and allows mixed V1/V2 connections
without requiring users to know which version their load balancer uses.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@antondalgren antondalgren requested a review from a team as a code owner January 8, 2026 13:57
Test is not valid anymore since we are now allowing any connection to use ProxyProtocol if it wants to.
@dentarg
Copy link
Member

dentarg commented Jan 8, 2026

Is removing the config options graceful, e.g. nothing happens if you still have them in the config with this?

Should we warn about unknown options in the config? So users can be aware and clean up cruft if they want to (you should also be able to silence such warnings)

@viktorerlingsson
Copy link
Member

Is removing the config options graceful, e.g. nothing happens if you still have them in the config with this?

Should we warn about unknown options in the config? So users can be aware and clean up cruft if they want to (you should also be able to silence such warnings)

Yes, removing options is OK. You get a warning when starting LavinMQ if you have them in your config: WARNING: Unrecognized configuration 'amqp/tcp_proxy_protocol'.

@viktorerlingsson
Copy link
Member

I'm thinking there might be some security concerns with always allowing PROXY protocol? Maybe we should keep the tcp_proxy_protocol & unix_proxy_protocol settings, but just as true/false. And use the automatic detection if it's V1/V2 from this PR.

@carlhoerberg
Copy link
Member

Yes, like Viktor says, proxy protocol should not be auto detected as per spec: https://github.com/haproxy/haproxy/blob/dbe52cc23e7fa15c6621e4b46896858b55f351fd/doc/proxy-protocol.txt#L865

We dont do IP based authentication much, but we do with the guest loopback thing, and could potentially add something more in the future and then forget about this.

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.

5 participants