mirror of
https://github.com/caddyserver/caddy.git
synced 2025-05-28 06:40:01 +08:00
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>
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user