Documentation ¶
Index ¶
- Variables
- func FakeIPEnabled() bool
- func FindHostByIP(ip netip.Addr) (string, bool)
- func FlushFakeIP() error
- func InsertHostByIP(ip netip.Addr, host string)
- func IsExistFakeIP(ip netip.Addr) bool
- func IsFakeBroadcastIP(ip netip.Addr) bool
- func IsFakeIP(ip netip.Addr) bool
- func LookupIP(ctx context.Context, host string) ([]netip.Addr, error)
- func LookupIPProxyServerHost(ctx context.Context, host string) ([]netip.Addr, error)
- func LookupIPWithResolver(ctx context.Context, host string, r Resolver) ([]netip.Addr, error)
- func LookupIPv4(ctx context.Context, host string) ([]netip.Addr, error)
- func LookupIPv4ProxyServerHost(ctx context.Context, host string) ([]netip.Addr, error)
- func LookupIPv4WithResolver(ctx context.Context, host string, r Resolver) ([]netip.Addr, error)
- func LookupIPv6(ctx context.Context, host string) ([]netip.Addr, error)
- func LookupIPv6ProxyServerHost(ctx context.Context, host string) ([]netip.Addr, error)
- func LookupIPv6WithResolver(ctx context.Context, host string, r Resolver) ([]netip.Addr, error)
- func MappingEnabled() bool
- func ResolveIP(ctx context.Context, host string) (netip.Addr, error)
- func ResolveIPWithResolver(ctx context.Context, host string, r Resolver) (netip.Addr, error)
- func ResolveIPv4(ctx context.Context, host string) (netip.Addr, error)
- func ResolveIPv4ProxyServerHost(ctx context.Context, host string) (netip.Addr, error)
- func ResolveIPv4WithResolver(ctx context.Context, host string, r Resolver) (netip.Addr, error)
- func ResolveIPv6(ctx context.Context, host string) (netip.Addr, error)
- func ResolveIPv6ProxyServerHost(ctx context.Context, host string) (netip.Addr, error)
- func ResolveIPv6WithResolver(ctx context.Context, host string, r Resolver) (netip.Addr, error)
- func ResolveProxyServerHost(ctx context.Context, host string) (netip.Addr, error)
- func ServeMsg(ctx context.Context, msg *D.Msg) (*D.Msg, error)
- func SortationAddr(ips []netip.Addr) (ipv4s, ipv6s []netip.Addr)
- func StoreFakePoolState()
- type Enhancer
- type HostValue
- type Hosts
- type LocalServer
- type Resolver
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultResolver aim to resolve ip DefaultResolver Resolver // ProxyServerHostResolver resolve ip to proxies server host ProxyServerHostResolver Resolver // DisableIPv6 means don't resolve ipv6 host // default value is true DisableIPv6 = true // DefaultHosts aim to resolve hosts DefaultHosts = NewHosts(trie.New[HostValue]()) // DefaultDNSTimeout defined the default dns request timeout DefaultDNSTimeout = time.Second * 5 )
Functions ¶
func FakeIPEnabled ¶
func FakeIPEnabled() bool
func FlushFakeIP ¶
func FlushFakeIP() error
func InsertHostByIP ¶
func IsExistFakeIP ¶
func IsFakeBroadcastIP ¶
func LookupIPProxyServerHost ¶
func LookupIPWithResolver ¶
LookupIPWithResolver same as LookupIP, but with a resolver
func LookupIPv4 ¶
LookupIPv4 with a host, return ipv4 list
func LookupIPv4WithResolver ¶
LookupIPv4WithResolver same as LookupIPv4, but with a resolver
func LookupIPv6 ¶
LookupIPv6 with a host, return ipv6 list
func LookupIPv6WithResolver ¶
LookupIPv6WithResolver same as LookupIPv6, but with a resolver
func MappingEnabled ¶
func MappingEnabled() bool
func ResolveIPWithResolver ¶
ResolveIPWithResolver same as ResolveIP, but with a resolver
func ResolveIPv4 ¶
ResolveIPv4 with a host, return ipv4
func ResolveIPv4ProxyServerHost ¶
ResolveIPv4ProxyServerHost proxies server host only
func ResolveIPv4WithResolver ¶
ResolveIPv4WithResolver same as ResolveIPv4, but with a resolver
func ResolveIPv6ProxyServerHost ¶
ResolveIPv6ProxyServerHost proxies server host only
func ResolveIPv6WithResolver ¶
ResolveIPv6WithResolver same as ResolveIPv6, but with a resolver
func ResolveProxyServerHost ¶
ResolveProxyServerHost proxies server host only
func StoreFakePoolState ¶
func StoreFakePoolState()
Types ¶
type Enhancer ¶
type Enhancer interface { FakeIPEnabled() bool MappingEnabled() bool IsFakeIP(netip.Addr) bool IsFakeBroadcastIP(netip.Addr) bool IsExistFakeIP(netip.Addr) bool FindHostByIP(netip.Addr) (string, bool) FlushFakeIP() error InsertHostByIP(netip.Addr, string) StoreFakePoolState() }
var DefaultHostMapper Enhancer
type Hosts ¶
type Hosts struct { *trie.DomainTrie[HostValue] }
type LocalServer ¶
var DefaultLocalServer LocalServer
type Resolver ¶
type Resolver interface { LookupIP(ctx context.Context, host string) (ips []netip.Addr, err error) LookupIPv4(ctx context.Context, host string) (ips []netip.Addr, err error) LookupIPv6(ctx context.Context, host string) (ips []netip.Addr, err error) ExchangeContext(ctx context.Context, m *dns.Msg) (msg *dns.Msg, err error) Invalid() bool }
Click to show internal directories.
Click to hide internal directories.