Documentation
¶
Overview ¶
Package TorBlockRedirect contains a Traefik plugin for blocking requests from the Tor network
Package TorBlockRedirect implements a Traefik plugin for blocking requests from the Tor network
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Enabled bool AddressListURL string UpdateIntervalSeconds int RedirectProtocol string RedirectHostname string RedirectSavePath bool ForwardedHeadersCustomName string }
Config holds the configuration for the plugin.
func CreateConfig ¶
func CreateConfig() *Config
CreateConfig initializes the default configuration for the plugin.
type IPv4 ¶
type IPv4 struct {
// contains filtered or unexported fields
}
IPv4 is a comparable representation of a 32bit IPv4 address.
func CreateIPv4 ¶
CreateIPv4 returns the IPv4 of the address a.b.c.d.
type IPv4Set ¶
type IPv4Set struct {
// contains filtered or unexported fields
}
IPv4Set contains a set of IPv4 addresses.
func (*IPv4Set) AddIPv4Set ¶ added in v0.1.3
Adding all IP addresses from another IPv4 set to the current set
func (*IPv4Set) ContainsIPv4 ¶
ContainsIPv4 checks for an existing IPv4 within the set.
type IPv6 ¶
type IPv6 struct {
// contains filtered or unexported fields
}
IPv6 is a comparable representation of an IPv6 address.
func CreateIPv6 ¶
CreateIPv6 returns the IPv6 address as a 16-byte array.
type IPv6Set ¶
type IPv6Set struct {
// contains filtered or unexported fields
}
IPv6Set contains a set of IPv6 addresses.
func (*IPv6Set) AddIPv6Set ¶ added in v0.1.3
Adding all IP addresses from another IPv6 set to the current set
func (*IPv6Set) ContainsIPv6 ¶
ContainsIPv6 checks for an existing IPv6 within the set.
type TorBlock ¶
type TorBlock struct { ForwardedHeadersCustomName string // contains filtered or unexported fields }
TorBlock represents the main structure of the plugin.
func (*TorBlock) ServeHTTP ¶
func (a *TorBlock) ServeHTTP(rw http.ResponseWriter, req *http.Request)
ServeHTTP processes each incoming request that passes through the plugin.
func (*TorBlock) UpdateBlockedIPs ¶
func (a *TorBlock) UpdateBlockedIPs()
UpdateBlockedIPs fetches the list of blocked IPs from the addressListURL and updates the blocked IP sets.
func (*TorBlock) UpdateWorker ¶
func (a *TorBlock) UpdateWorker()
UpdateWorker periodically updates the list of blocked IPs according to the update interval.