Closed rob-duewer closed 6 years ago
Goldfish current uses https://github.com/labstack/echo to launch the backend server. I would rather not alter the source code of that package. Therefore, unless that package supports this feature, I don't think there is an easy way to implement this.
Feature request:
Is this a front-end feature or backend? (or both?) Front-end
Description of feature: When running goldfish behind a proxy (HAProxy, AWS ELB, etc), TLS bridging can be used, making use of higher level http header proxy labels non-feasible. In this case, the log information for goldfish will reflect the IP address of the proxy and not the original source address. Enter the proxy protocol to be able to optionally provide this information.
Looking around, others have already worked on implementing a go library that can optionally handle it, providing both a net.Listener and net.Conn implementation that can likely simplify implementing this in a frontend like goldfish.
Example: https://github.com/armon/go-proxyproto
Current proxy protocol whitepaper: https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt
Are you able to submit a pull request for this feature? Maybe. I don't have a hard use case where I must expose and log original addresses yet, so have not had time to investigate degree of difficulty more deeply or to purpose a PR. But since I see a number of FR to support proxies and AWS in general; I figured I'd raise it before I had a chance to invest more time on the idea, in case anyone else was interested in it.