l4proxyprotocol

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConn

func GetConn(cx *layer4.Connection) net.Conn

GetConn gets the connection which holds the information received from the PROXY protocol.

Types

type Handler

type Handler struct {
	// How long to wait for the PROXY protocol header to be received.
	// Defaults to zero, which means timeout is disabled.
	Timeout caddy.Duration `json:"timeout,omitempty"`

	// An optional list of CIDR ranges to allow/require PROXY headers from.
	Allow []string `json:"allow,omitempty"`
	// contains filtered or unexported fields
}

Handler is a connection handler that accepts the PROXY protocol.

func (*Handler) CaddyModule

func (*Handler) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (*Handler) Handle

func (h *Handler) Handle(cx *layer4.Connection, next layer4.Handler) error

Handle handles the connections.

func (*Handler) Provision

func (h *Handler) Provision(ctx caddy.Context) error

Provision sets up the module.

func (*Handler) UnmarshalCaddyfile

func (h *Handler) UnmarshalCaddyfile(d *caddyfile.Dispenser) error

UnmarshalCaddyfile sets up the Handler from Caddyfile tokens. Syntax:

proxy_protocol {
	allow <ranges...>
	timeout <duration>
}

proxy_protocol

type MatchProxyProtocol

type MatchProxyProtocol struct{}

func (*MatchProxyProtocol) CaddyModule

func (*MatchProxyProtocol) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (*MatchProxyProtocol) Match

func (m *MatchProxyProtocol) Match(cx *layer4.Connection) (bool, error)

Match returns true if the connection looks like it is using the Proxy Protocol.

func (*MatchProxyProtocol) UnmarshalCaddyfile

func (m *MatchProxyProtocol) UnmarshalCaddyfile(d *caddyfile.Dispenser) error

UnmarshalCaddyfile sets up the MatchProxyProtocol from Caddyfile tokens. Syntax:

proxy_protocol

Jump to

Keyboard shortcuts

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