fix: refactor proxy header logic into ConnectionStream#157
Open
junderw wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors PROXY-protocol (HAProxy) header parsing so it lives inside ConnectionStream, enabling early/non-blocking resolution of the proxied client address for logging and per-client connection limiting.
Changes:
- Introduces
ConnectionStreambuffering (leftover) and one-shot PROXY probing (resolve_proxy) to strip headers before request parsing. - Updates connection lifecycle/logging to use an eagerly resolved client identifier.
- Simplifies the request reader by removing the prior pre-read/
Cursorchaining logic.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
00df937 to
82bf715
Compare
82bf715 to
ae924b2
Compare
351266a to
d351a40
Compare
d351a40 to
8c6f855
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NGINX sends the Proxy header as soon as the client finishes the TCP connection regardless of whether the client sends anything yet... so this should work out fine.