Documentation
¶
Index ¶
Constants ¶
View Source
const ( V2_VERSION = uint8(0x2 << 4) V2_CMD_LOCAL = uint8(0x0) // Unused in this library V2_CMD_PROXY = uint8(0x1) )
Version & Command field (byte 13 - section 2.2 of spec)
View Source
const ( V2_AF_UNSPEC = uint8(0x0 << 4) V2_AF_INET = uint8(0x1 << 4) V2_AF_INET6 = uint8(0x2 << 4) V2_AF_UNIX = uint8(0x3 << 4) V2_TRANSPORT_UNSPEC = uint8(0x0) V2_TRANSPORT_STREAM = uint8(0x1) V2_TRANSPORT_DGRAM = uint8(0x2) )
Address Family & Transport Protocol field (byte 14 - section 2.2 of spec)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HAproxy_conn ¶
type HAproxy_conn struct {
// contains filtered or unexported fields
}
func New ¶
func New(proxy_addr_port, source_addr_port, dest_addr_port string) (*HAproxy_conn, error)
Register a new PROXY Protocol (https://www.haproxy.org/download/2.6/doc/proxy-protocol.txt) association, comprising:
The address:port to reach the proxy service. source address:port - that the proxy should use for its outward connection. This address must be hosted on the proxy. You can specify port=0 to have the proxy choose an ephemeral port. destination address:port - remote service that the proxy should connect to. Addresses should be valid IPv4.
func (*HAproxy_conn) V1_Bytes ¶
func (c *HAproxy_conn) V1_Bytes() ([]byte, error)
Return the PROXY connection header in version 1 (text) format, as a byte slice Note V1 in any case only supports TCP (stream) connections, not UDP
func (*HAproxy_conn) V1_proto ¶ added in v0.2.0
func (c *HAproxy_conn) V1_proto() string
Return the protocol version/family (section 2.1 of spec)
func (*HAproxy_conn) V2_Bytes ¶
func (c *HAproxy_conn) V2_Bytes() ([]byte, error)
Return the PROXY connection header in version 2 (binary) format, as a byte slice Currently this conversion assumes stream (TCP) connection type only. TODO: support UDP connection types.
func (*HAproxy_conn) V2_proto ¶ added in v0.2.0
func (c *HAproxy_conn) V2_proto() uint8
Click to show internal directories.
Click to hide internal directories.