Documentation
¶
Overview ¶
Package proxy applies X-Forwarded-For, X-Forwarded-Proto and X-Forwarded-Host from trusted reverse proxies (#112, ADR-0035). Headers from any other address are ignored: a client could otherwise pick its own IP for rate limiting and logs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Middleware ¶
Middleware rewrites RemoteAddr, Host and the scheme of requests that come from a trusted proxy. The client is the rightmost X-Forwarded-For address that is not itself a trusted proxy, so a chain of proxies works and a forged leftmost entry is ignored. With no trusted proxies the middleware does nothing.
func ParsePrefixes ¶
ParsePrefixes parses CIDRs and single addresses ("10.0.0.0/8", "127.0.0.1", "::1").
Types ¶
This section is empty.