Skip to content

Conversation

@peterverraedt
Copy link

Support the proxy protocol in TCP and TLS listeners, to allow Adguard to be placed behind a load balancer/proxy such as nginx or traefik. If the connection is made from one of the trusted proxies ip addresses, it is allowed - but not required - that TCP and TLS connections contain a proxy protocol header to pass source connection information. If a connection is made from other ip addresses, no proxy protocol header is allowed.

We don't allow proxy protocol in the HTTPS or QUIC listeners as there the source ip information can be passed by HTTP headers instead.

This fixes AdguardTeam/AdGuardHome#2798.

Copy link

@windsurf-bot windsurf-bot bot left a comment

Choose a reason for hiding this comment

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

💡 To request another review, post a new comment with "/windsurf-review".

@peterverraedt
Copy link
Author

/windsurf-review

Copy link

@windsurf-bot windsurf-bot bot left a comment

Choose a reason for hiding this comment

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

💡 To request another review, post a new comment with "/windsurf-review".

If the connection is made from one of the trusted proxies ip addresses,
it is allowed that TCP and TLS connections contain a proxyprotocol
header to pass source connection information. This in particular allows
dns over tls behind a load balancer, while keeping source ip address
information.

Signed-off-by: Peter Verraedt <peter@verraedt.be>
@peterverraedt
Copy link
Author

/windsurf-review

Copy link

@windsurf-bot windsurf-bot bot left a comment

Choose a reason for hiding this comment

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

Looks good to me 🤙

💡 To request another review, post a new comment with "/windsurf-review".

@xduugu
Copy link

xduugu commented Dec 3, 2025

Thanks a lot for your work on this, @peterverraedt.

Have you happened to look at the UDP support as well, and can you estimate how difficult it would be to implement? As far as I know, pires/go-proxyproto already supports proxy protocol v2 for UDP.

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.

Support PROXY Protocol

2 participants