MCPcopy
hub / github.com/caddyserver/caddy / MatchRemoteIP

Struct MatchRemoteIP

modules/caddytls/matchers.go:310–320  ·  view source on GitHub ↗

MatchRemoteIP matches based on the remote IP of the connection. Specific IPs or CIDR ranges can be specified. Note that IPs can sometimes be spoofed, so do not rely on this as a replacement for actual authentication.

Source from the content-addressed store, hash-verified

308// Note that IPs can sometimes be spoofed, so do not rely
309// on this as a replacement for actual authentication.
310type MatchRemoteIP struct {
311 // The IPs or CIDR ranges to match.
312 Ranges []string `json:"ranges,omitempty"`
313
314 // The IPs or CIDR ranges to *NOT* match.
315 NotRanges []string `json:"not_ranges,omitempty"`
316
317 cidrs []netip.Prefix
318 notCidrs []netip.Prefix
319 logger *zap.Logger
320}
321
322// CaddyModule returns the Caddy module information.
323func (MatchRemoteIP) CaddyModule() caddy.ModuleInfo {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected