reverseproxy: PROXY protocol support for http transport#4855
reverseproxy: PROXY protocol support for http transport#4855WeidiDeng wants to merge 3 commits intocaddyserver:masterfrom
Conversation
|
Cool, I'm excited to review this! Currently traveling but will try to squeeze it in. |
| var proxyProtocolInfo ProxyProtocolInfo | ||
| // using X-Forwarded-For header which is already filtered by trusted proxies | ||
| if xff := r.Header.Get("X-Forwarded-For"); xff != "" { | ||
| ip := net.ParseIP(xff) |
There was a problem hiding this comment.
This isn't safe, X-Forwarded-For could contain a comma separated list of IP addresses.
There was a problem hiding this comment.
I forget that caddy set it as a string 😇, will change it.
mholt
left a comment
There was a problem hiding this comment.
Thanks for implementing this! I agree with Francis' comments so far. I've only done a first pass at this point; I think I have more to say about the ProxyProtocolInfo stuff -- or maybe not, but I do need to spend more time when I have a chance and understand it a little better, and make sure it's the best way to do things.
Thanks again for working on this and for your patience!
|
I think this needs a rebase @WeidiDeng if you could update the PR! Please remember to use the new |
|
Superseded by 5424. |
Add proxy protocol support for reverseproxy http transport
fix 2724.