Documentation
¶
Overview ¶
Package proxyprotocol partially implements PROXY protocol proposed by HAProxy, aiming at high-performance integration with the rest of ZBProxy. The full protocol specification can be found at https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt
Index ¶
Constants ¶
View Source
const ( VersionUnspecified = iota Version1 Version2 )
View Source
const ( CommandLocal = 0x0 CommandProxy = 0x1 TransportProtocolIPv4 = 0x10 TransportProtocolIPv6 = 0x20 TransportProtocolUnix = 0x30 TransportProtocolStream = 0x1 TransportProtocolDatagram = 0x2 )
Variables ¶
View Source
var (
ErrNotProxyProtocol = errors.New("not PROXY protocol")
)
Functions ¶
func AddressFamilyByAddr ¶
func HandleConnection ¶
HandleConnection reads PROXY protocol header from the connection, returning whether the source address is changed and the error (if present).
Types ¶
Click to show internal directories.
Click to hide internal directories.