Documentation
¶
Index ¶
- Constants
- Variables
- func CustomDialContext(ctx context.Context, network, addr string) (net.Conn, error)
- func CustomTLS(ca *tls.Certificate) func(host string, ctx *goproxy.ProxyCtx) (*tls.Config, error)
- func GetClient() *http.Client
- func GetDirectClient() *http.Client
- func IPs(resp *dns.Response) []string
- func Reload()
- func TTL(resp *dns.Response) int
- type AntizapretConfig
- type AntizapretProxy
- type CustomProxy
- type DoH
- type DomainEntry
- type LengthEntry
- type PatternEntry
- type Provider
- type SpecialEntry
Constants ¶
View Source
const ( CloudflareProvider provider = iota DNSPodProvider GoogleProvider Quad9Provider )
DoH Providers enum
View Source
const CACHE_TTL = 24 * time.Hour // 24 hour caching
View Source
const CONFIG_FILE_NAME = "antizapret_config.gob" // Using gob for caching
View Source
const HASH_MASK = (1 << TABLE_LEN_BITS) - 1
View Source
const TABLE_LEN_BITS = 18
variables for unlzp function
View Source
const USER_AGENT = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36"
Variables ¶
View Source
var ( ResponseTypeA = 1 ResponseTypeAAAA = 28 )
Supported dns response types
View Source
var ( // Proxy ... Proxy = goproxy.NewProxyHttpServer() // ProxyPort ... ProxyPort = 65222 )
View Source
var AlwaysHTTPMitm goproxy.FuncHttpsHandler = func(host string, ctx *goproxy.ProxyCtx) (*goproxy.ConnectAction, string) { return &goproxy.ConnectAction{Action: goproxy.ConnectMitm, TLSConfig: CustomTLS(&goproxy.GoproxyCa)}, host }
AlwaysHTTPMitm ...
View Source
var CACHE_DIR = ""
View Source
var ( Providers = []provider{ CloudflareProvider, DNSPodProvider, GoogleProvider, Quad9Provider, } )
DoH Providers list
Functions ¶
func CustomDialContext ¶
CustomDialContext ...
Types ¶
type AntizapretConfig ¶ added in v0.1.112
type AntizapretConfig struct {
CreatedAt time.Time
Domains []DomainEntry // Use slice to preserve order of TLD
Special []SpecialEntry // Use slice to preserve order
DIpaddr []uint32 // IP addresses stored as big-endian uint32
PatternsDomainsLzp []PatternEntry // Use slice to preserve order
PatternsMaskLzp []PatternEntry // Use slice to preserve order
ThreePartSuffixesPattern string
ProxyURL string
}
type AntizapretProxy ¶ added in v0.1.112
type AntizapretProxy struct {
// contains filtered or unexported fields
}
AntizapretProxy struct
func NewAntizapretProxy ¶ added in v0.1.112
func NewAntizapretProxy() *AntizapretProxy
Constructor for AntizapretProxy
func (*AntizapretProxy) Detect ¶ added in v0.1.112
func (ap *AntizapretProxy) Detect(host string) string
Detect if a host needs proxying Returns the proxy URL string if proxy is needed, otherwise returns an empty string.
func (*AntizapretProxy) Update ¶ added in v0.1.112
func (ap *AntizapretProxy) Update()
type CustomProxy ¶
CustomProxy stores http.Server with field showing there was an error while listening.
type DoH ¶ added in v0.1.103
DoH is doh client
func UseProviders ¶ added in v0.1.103
func UseProviders(provider ...provider) *DoH
type DomainEntry ¶ added in v0.1.112
type DomainEntry struct {
TLD string
Lengths []LengthEntry // Use slice to preserve order
}
type LengthEntry ¶ added in v0.1.112
type PatternEntry ¶ added in v0.1.112
Structs to hold the configuration data
type Provider ¶ added in v0.1.103
type Provider interface {
Query(context.Context, dns.Domain, dns.Type, ...dns.ECS) (*dns.Response, error)
String() string
}
Provider is the provider interface
type SpecialEntry ¶ added in v0.1.112
Click to show internal directories.
Click to hide internal directories.