Documentation
¶
Overview ¶
Package proxytlv is a caddy-l4 handler that tells the upstream what a TLS-terminating edge saw. It writes a PROXY protocol v2 header ahead of the client's stream carrying:
source / destination the real client, and the address it dialled PP2_TYPE_AUTHORITY the SNI hostname PP2_TYPE_ALPN the negotiated application protocol PP2_TYPE_SSL "the client leg was TLS", + PP2_SUBTYPE_SSL_VERSION
That header IS the contract; the receiving side needs no knowledge of Caddy (HAProxy's `send-proxy-v2-ssl` + `proxy-v2-options authority` produces the same thing). This module exists only because caddy-l4's `proxy` handler writes PROXY headers without TLVs — delete it the day `proxy` can emit them itself.
Place it after `tls` and before `proxy`, and leave `proxy_protocol` off the `proxy` handler (it would add a second header):
route {
proxy_protocol { allow 172.16.0.0/12 } # optional: the hop in front of Caddy
tls
proxy_tlv
proxy { upstream chassis.internal:16697 }
}
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler prepends a PROXY v2 header with TLS TLVs to the client stream. It has no options.
func (*Handler) CaddyModule ¶
func (*Handler) CaddyModule() caddy.ModuleInfo
CaddyModule returns the Caddy module information.
func (*Handler) Handle ¶
Handle builds the header from what the earlier handlers recorded on the connection and hands the next handler a stream that starts with it.