Documentation
¶
Index ¶
- Constants
- Variables
- func CacheBust() string
- func ClearCookie(name string, w http.ResponseWriter, r *http.Request)
- func EnsureNoOpenRedirect(redirect string) (string, error)
- func FetchTags(backend http.Handler, uri *url.URL, kinds ...string) (result []html.Node)
- func GetRemoteAddress(ctx context.Context) *netip.AddrPort
- func GetRequestAddress(r *http.Request, clientHeader string) netip.AddrPort
- func GetRequestScheme(r *http.Request) string
- func MakeReverseProxy(target string, goDns bool, dialTimeout time.Duration) (*httputil.ReverseProxy, error)
- func NewServer(handler http.Handler, tlsConfig *tls.Config) *http.Server
- func SelectHTTPHandler(backends map[string]http.Handler, host string) http.Handler
- func SetCookie(name, value string, expiry time.Time, w http.ResponseWriter, r *http.Request)
- func SetRemoteAddress(r *http.Request, addrPort netip.AddrPort) *http.Request
- type Cache
- type DNSBL
- type DNSBLResponse
- type DecayMap
- type DecayMapEntry
- type RADb
- type Strings
- type TLSFingerprint
- type TLSFingerprintJA3N
- type TLSFingerprintJA4
- type UnixRoundTripper
Constants ¶
View Source
const ( ResponseGood = DNSBLResponse(0) ResponseUnknown = DNSBLResponse(255) )
View Source
const RADBServer = "whois.radb.net:43"
Variables ¶
View Source
var DefaultCookiePrefix = ".go-away-"
View Source
var ErrExpired = errors.New("key expired")
Functions ¶
func ClearCookie ¶
func ClearCookie(name string, w http.ResponseWriter, r *http.Request)
func EnsureNoOpenRedirect ¶
func GetRequestAddress ¶ added in v0.5.0
func GetRequestScheme ¶ added in v0.5.0
func MakeReverseProxy ¶
func SelectHTTPHandler ¶ added in v0.5.0
Types ¶
type Cache ¶ added in v0.5.0
type Cache interface { Get(key string, maxAge time.Duration) ([]byte, error) Set(key string, value []byte) error }
func CacheDirectory ¶ added in v0.5.0
func CachePrefix ¶ added in v0.5.0
type DNSBLResponse ¶ added in v0.3.0
type DNSBLResponse uint8
func (DNSBLResponse) Bad ¶ added in v0.3.0
func (r DNSBLResponse) Bad() bool
type DecayMap ¶ added in v0.3.0
type DecayMap[K comparable, V any] struct { // contains filtered or unexported fields }
func NewDecayMap ¶ added in v0.3.0
func NewDecayMap[K comparable, V any]() *DecayMap[K, V]
type DecayMapEntry ¶ added in v0.3.0
type DecayMapEntry[V any] struct { Value V // contains filtered or unexported fields }
type RADb ¶ added in v0.5.0
type RADb struct {
// contains filtered or unexported fields
}
func (*RADb) FetchASNets ¶ added in v0.5.0
type Strings ¶ added in v0.7.0
func NewStrings ¶ added in v0.7.0
type TLSFingerprint ¶ added in v0.4.0
type TLSFingerprint struct {
// contains filtered or unexported fields
}
func GetTLSFingerprint ¶ added in v0.4.0
func GetTLSFingerprint(r *http.Request) *TLSFingerprint
func (*TLSFingerprint) JA3N ¶ added in v0.4.0
func (f *TLSFingerprint) JA3N() *TLSFingerprintJA3N
func (*TLSFingerprint) JA4 ¶ added in v0.4.0
func (f *TLSFingerprint) JA4() *TLSFingerprintJA4
type TLSFingerprintJA3N ¶ added in v0.4.0
func (TLSFingerprintJA3N) String ¶ added in v0.4.0
func (f TLSFingerprintJA3N) String() string
type TLSFingerprintJA4 ¶ added in v0.4.0
func (TLSFingerprintJA4) String ¶ added in v0.4.0
func (f TLSFingerprintJA4) String() string
Source Files
¶
Click to show internal directories.
Click to hide internal directories.