Documentation
¶
Overview ¶
Package dnsbl2 provides a Caddy HTTP request matcher backed by DNS blocklists.
Index ¶
- type MatchDNSBL
- func (MatchDNSBL) CaddyModule() caddy.ModuleInfo
- func (m *MatchDNSBL) Match(r *http.Request) bool
- func (m *MatchDNSBL) MatchWithError(r *http.Request) (bool, error)
- func (m *MatchDNSBL) Provision(ctx caddy.Context) error
- func (m *MatchDNSBL) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
- func (m *MatchDNSBL) Validate() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MatchDNSBL ¶
type MatchDNSBL struct {
// Providers is the list of DNSBL zones to query.
Providers []string `json:"providers,omitempty"`
// Timeout limits the total time spent checking all providers for a request.
// The default is 2 seconds.
Timeout caddy.Duration `json:"timeout,omitempty"`
// contains filtered or unexported fields
}
MatchDNSBL matches requests whose client IP is listed by at least one DNSBL provider.
func (MatchDNSBL) CaddyModule ¶
func (MatchDNSBL) CaddyModule() caddy.ModuleInfo
CaddyModule returns the Caddy module information.
func (*MatchDNSBL) Match ¶
func (m *MatchDNSBL) Match(r *http.Request) bool
Match reports whether the request matches. It is retained for compatibility with Caddy versions that use caddyhttp.RequestMatcher.
func (*MatchDNSBL) MatchWithError ¶
func (m *MatchDNSBL) MatchWithError(r *http.Request) (bool, error)
MatchWithError reports whether the request's client IP is listed by any configured provider. DNS errors fail open and do not match.
func (*MatchDNSBL) Provision ¶
func (m *MatchDNSBL) Provision(ctx caddy.Context) error
Provision prepares the matcher for use.
func (*MatchDNSBL) UnmarshalCaddyfile ¶
func (m *MatchDNSBL) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
UnmarshalCaddyfile implements caddyfile.Unmarshaler. Syntax:
dnsbl2 {
providers <zones...>
timeout <duration>
}
func (*MatchDNSBL) Validate ¶
func (m *MatchDNSBL) Validate() error
Validate validates the matcher configuration.
Click to show internal directories.
Click to hide internal directories.