Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions modules/caddyhttp/proxyprotocol/listenerwrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,16 @@ type ListenerWrapper struct {
Timeout caddy.Duration `json:"timeout,omitempty"`

// Allow is an optional list of CIDR ranges to
// allow/require PROXY headers from.
// allow PROXY headers from.
// Note that while the PROXY protocol is allowed,
// it is not required to be used by clients in this range.
Allow []string `json:"allow,omitempty"`
allow []netip.Prefix

// Deny is an optional list of CIDR ranges to
// deny PROXY headers from.
// Connections without PROXY headers from clients
// in this range are still allowed.
Comment on lines +44 to +53
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's more fair/accurate to mention it's dependant on the fallback policy, and it should use may instead of are. What do you think?

Deny []string `json:"deny,omitempty"`
deny []netip.Prefix

Expand All @@ -63,7 +67,7 @@ type ListenerWrapper struct {
//
// - USE: address from PROXY header
//
// - REJECT: connection when PROXY header is sent
// - REJECT: connection when PROXY header is sent.
// Note: even though the first read on the connection returns an error if
// a PROXY header is present, subsequent reads do not. It is the task of
// the code using the connection to handle that case properly.
Expand Down
Loading