Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for proxy protocol in listener #915

Closed
wants to merge 4 commits into from
Closed

Conversation

mmatczuk
Copy link
Contributor

Added server options

    --proxy-protocol-enabled <value> (default false) (env FORWARDER_PROXY_PROTOCOL_ENABLED)
        The PROXY protocol is used to correctly read the client's IP address. When enabled the proxy will expect the
        client to send the PROXY protocol header before the actual request. It is still possible to connect to the
        proxy without the PROXY protocol header when this flag is enabled.

    --proxy-protocol-read-header-timeout <duration> (default 10s) (env FORWARDER_PROXY_PROTOCOL_READ_HEADER_TIMEOUT)
        The amount of time to wait for PROXY protocol header. Zero means no limit.

Fixes #912

The mod file contains replace directive to include my fixes to the library [1].

[1] pires/go-proxyproto#116
    --proxy-protocol-enabled <value> (default false) (env FORWARDER_PROXY_PROTOCOL_ENABLED)
        The PROXY protocol is used to correctly read the client's IP address. When enabled the proxy will expect the
        client to send the PROXY protocol header before the actual request. It is still possible to connect to the
        proxy without the PROXY protocol header when this flag is enabled.

    --proxy-protocol-read-header-timeout <duration> (default 10s) (env FORWARDER_PROXY_PROTOCOL_READ_HEADER_TIMEOUT)
        The amount of time to wait for PROXY protocol header. Zero means no limit.
Enable proxy protocol by default in tests.
Add tests to check if XFF header is properly updated.
@mmatczuk
Copy link
Contributor Author

Closing this as we want something with better listener design.

@mmatczuk mmatczuk closed this Sep 18, 2024
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 for downstream connection
2 participants