proxyproto

package
v0.1.0-rc.40 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package proxyproto implements tnl's strict PROXY protocol v2 boundary. it accepts one TCP-over-IPv4 or TCP-over-IPv6 header and rejects other versions, commands, transports, extensions, and duplicate headers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encode

func Encode(header Header) ([]byte, error)

Types

type ErrorCode

type ErrorCode string
const (
	ErrorInvalidSignature     ErrorCode = "invalid_signature"
	ErrorUnsupportedVersion   ErrorCode = "unsupported_version"
	ErrorUnsupportedCommand   ErrorCode = "unsupported_command"
	ErrorUnsupportedTransport ErrorCode = "unsupported_transport"
	ErrorInvalidLength        ErrorCode = "invalid_length"
	ErrorTruncatedHeader      ErrorCode = "truncated_header"
	ErrorInvalidAddress       ErrorCode = "invalid_address"
	ErrorDuplicateHeader      ErrorCode = "duplicate_header"
)
type Header struct {
	Source      netip.AddrPort
	Destination netip.AddrPort
}

func Decode

func Decode(reader io.Reader) (Header, io.Reader, error)

type ProtocolError

type ProtocolError struct {
	Code ErrorCode
}

func (*ProtocolError) Error

func (e *ProtocolError) Error() string

Jump to

Keyboard shortcuts

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