diff options
author | Corin Langosch <info@corinlangosch.com> | 2023-03-31 23:44:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-31 17:44:53 -0400 |
commit | b6fe5d4b41d07e70a502ed58d40e8b0e75067db5 (patch) | |
tree | 5be3fd6968105029b9c28c7e9c4c8d3a806dcbf4 /modules/caddyhttp/reverseproxy/hosts.go | |
parent | 66e571e687eeddca0aafd5df0e3ab5f7cecbdcfa (diff) |
proxyprotocol: Add PROXY protocol support to `reverse_proxy`, add HTTP listener wrapper (#5424)
Co-authored-by: WeidiDeng <weidi_deng@icloud.com>
Co-authored-by: Francis Lavoie <lavofr@gmail.com>
Diffstat (limited to 'modules/caddyhttp/reverseproxy/hosts.go')
-rw-r--r-- | modules/caddyhttp/reverseproxy/hosts.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/caddyhttp/reverseproxy/hosts.go b/modules/caddyhttp/reverseproxy/hosts.go index a973ecb..b97c8b4 100644 --- a/modules/caddyhttp/reverseproxy/hosts.go +++ b/modules/caddyhttp/reverseproxy/hosts.go @@ -19,6 +19,7 @@ import ( "fmt" "net" "net/http" + "net/netip" "strconv" "sync/atomic" @@ -259,3 +260,13 @@ var hosts = caddy.NewUsagePool() // dialInfoVarKey is the key used for the variable that holds // the dial info for the upstream connection. const dialInfoVarKey = "reverse_proxy.dial_info" + +// proxyProtocolInfoVarKey is the key used for the variable that holds +// the proxy protocol info for the upstream connection. +const proxyProtocolInfoVarKey = "reverse_proxy.proxy_protocol_info" + +// ProxyProtocolInfo contains information needed to write proxy protocol to a +// connection to an upstream host. +type ProxyProtocolInfo struct { + AddrPort netip.AddrPort +} |