Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadCloudFront ¶
func LoadCloudflare ¶
func MustParseCIDR ¶
Types ¶
type AwsIPRanges ¶
type CIDRSet ¶
type CIDRSet struct {
Ranges []*net.IPNet
Update CIDRUpdater
}
type CIDRUpdater ¶
type RealIP ¶
type RealIP struct {
// Presets stores the presets that should be loaded
Presets []string `json:"presets"`
// From stores any manually included presets
From []*net.IPNet `json:"from"`
// Header to load an IP Address from typically X-Forwarded-For
Header string `json:"header"`
// MaxHops configures the maxiumum number of hops or IPs to be found in a forward header.
// It's purpose is to prevent abuse and/or DOS attacks from long forward-chains, since each one
// must be parsed and checked against a list of subnets.
// The default is 5, -1 to disable. If set to 0, any request with a forward header will be rejected
MaxHops int `json:"max_hops"`
// Will reject the request if a valid IP address can not be found
Strict bool `json:"strict"`
// How often the dynamic presets are reloaded
RefreshFrequency caddy.Duration `json:"refresh_frequency"`
// contains filtered or unexported fields
}
func (RealIP) CaddyModule ¶
func (RealIP) CaddyModule() caddy.ModuleInfo
Click to show internal directories.
Click to hide internal directories.