Skip to content

feat: Adding support for HA Proxy's PROXY protocol#259

Open
donovanhubbard wants to merge 3 commits into
gliderlabs:masterfrom
donovanhubbard:proxy
Open

feat: Adding support for HA Proxy's PROXY protocol#259
donovanhubbard wants to merge 3 commits into
gliderlabs:masterfrom
donovanhubbard:proxy

Conversation

@donovanhubbard
Copy link
Copy Markdown

In 2011 the people working on HA Proxy developed what would be known as the PROXY protocol. This solved the problem of how upstream load balancers and proxies could pass information about the original client's IP address and port to the backend server.

In order to take advantage of the PROXY protocol, the load balancer must send the PROXY header and the backend server needs to be able to read the header. The protocol is supported by a wide variety of load balancers including:

  • HA Proxy
  • nginx
  • Amazon Application Load Balancers
  • Traefik
  • Envoy
  • Cloudflare

This pull request adds support for the PROXY protocol to the ssh server via a new option called EnableProxyProtocol. An example has been included in the _examples directory.

This is accomplished through the https://github.com/pires/go-proxyproto library. It replaces the information returned by the ssh.Session object's RemoteAdd() function with the requestor's original IP address and port and not the load balancer's load balancer and port which is what would be displayed without this protocol.

@donovanhubbard donovanhubbard changed the title Adding support for HA Proxy's PROXY protocol feat: Adding support for HA Proxy's PROXY protocol May 17, 2026
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.

1 participant