Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

WIP: Add support to haproxy's proxy-protocol #34

Closed
wants to merge 1 commit into from

Conversation

cezarsa
Copy link
Member

@cezarsa cezarsa commented Nov 7, 2017

This is a work in progress.

The PR adds support to HAProxy to reverse proxy engines. Only proxy-protocol v2 will be supported as it's both easier and faster to parse.

Done:

  • Native implementation

Missing:

  • Fasthttp implementation
  • Tests
  • Benchmarks

Caveats:

There are some major possible performance implications in the native reverseproxy implementation. Reading the proxy protocol's header happens when we receive a StateNew ConnState() call and it blocks until we've finished reading the header, as we must prevent http.Server from reading from this connection until we're done. The problem is that http.Server calls the setState before a new goroutine is spawned for the new connection, this means we're blocking the Accept loop thus delaying accepting new connections. I don't see a better way for now besides checking with the Go team for the possibility of including a new connection state triggered from inside the new goroutine.

Fixes #33

@cezarsa cezarsa closed this Jan 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

log real client ip address
1 participant