proxyprotocol

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAddressFamilyMismatch = errors.New("address family between source and target mismatched")
)
View Source
var (
	MagicV2 = []byte{0xD, 0xA, 0xD, 0xA, 0x0, 0xD, 0xA, 0x51, 0x55, 0x49, 0x54, 0xA}
)

Functions

This section is empty.

Types

type AddressWrapper

type AddressWrapper interface {
	net.Addr
	Unwrap() net.Addr
}

type Listener

type Listener struct {
	net.Listener
}

func NewListener

func NewListener(o net.Listener) *Listener

func (*Listener) Accept

func (n *Listener) Accept() (net.Conn, error)

type Proxy

type Proxy struct {
	SrcAddress net.Addr
	DstAddress net.Addr
	TLV        []ProxyTlv
	Version    ProxyVersion
	Command    ProxyCommand
}

func ParseProxyV2

func ParseProxyV2(rd io.Reader) (m *Proxy, n int, err error)

func (*Proxy) ToBytes

func (p *Proxy) ToBytes() ([]byte, error)

type ProxyAddressFamily

type ProxyAddressFamily int
const (
	ProxyAFUnspec ProxyAddressFamily = iota
	ProxyAFINet
	ProxyAFINet6
	ProxyAFUnix
)

type ProxyCommand

type ProxyCommand int
const (
	ProxyCommandLocal ProxyCommand = iota
	ProxyCommandProxy
)

type ProxyNetwork

type ProxyNetwork int
const (
	ProxyNetworkUnspec ProxyNetwork = iota
	ProxyNetworkStream
	ProxyNetworkDgram
)

type ProxyTlv

type ProxyTlv struct {
	Content []byte
	Typ     ProxyTlvType
}

type ProxyTlvType

type ProxyTlvType int
const (
	ProxyTlvALPN ProxyTlvType = iota + 0x01
	ProxyTlvAuthority
	ProxyTlvCRC32C
	ProxyTlvNoop
	ProxyTlvUniqueID
	ProxyTlvSSL ProxyTlvType = iota + 0x20
	ProxyTlvSSLCN
	ProxyTlvSSLCipher
	ProxyTlvSSLSignALG
	ProxyTlvSSLKeyALG
	ProxyTlvNetns ProxyTlvType = iota + 0x30
)

type ProxyVersion

type ProxyVersion int
const (
	ProxyVersion2 ProxyVersion = iota + 2
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL