Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FastUpstream ¶
type FastUpstream struct { Logger *zap.Logger // Nil value disables the logger. // Addr is a network "host:port" addr Addr string Protocol Protocol // Default is ProtocolUDP. Socks5 string // Used by "tcp", "dot", "doh" as Socks5 server addr. ServerName string // Used by "dot" as server certificate name. It cannot be empty. URL string // Used by "doh" as server endpoint url. It cannot be empty. // ReadTimeout // In "udp", "tcp", "dot", it's read timeout. // In "doh", it's a time limit for the query, including dialing connections. // Default is generalReadTimeout. ReadTimeout time.Duration // IdleTimeout used by "tcp", "dot", "doh" to control connection idle timeout. // Default: "tcp" & "dot": 0 (disable connection reuse), "doh": 30s. IdleTimeout time.Duration // MaxConns limits the total number of connections, // including connections in the dialing states. // Used by "udp"(fallback to tcp), "tcp", "dot", "doh". Default: 1. MaxConns int RootCA *x509.CertPool InsecureSkipVerify bool // Used by "dot", "doh". Skip tls verification. // contains filtered or unexported fields }
FastUpstream is a udp, tcp, dot, doh upstream
func (*FastUpstream) ExchangeNoTruncated ¶ added in v1.5.2
type Transport ¶ added in v1.5.2
type Transport struct { // Nil logger disables logging. Logger *zap.Logger // The following funcs cannot be nil. DialFunc func() (net.Conn, error) WriteFunc func(c io.Writer, m *dns.Msg) (n int, err error) ReadFunc func(c io.Reader) (m *dns.Msg, n int, err error) // MaxConns controls the maximum connections Transport can open. // It includes dialing connections. // Default is 1. MaxConns int // IdleTimeout controls the maximum idle time for each connection. // If IdleTimeout <= 0, Transport will not reuse connections. IdleTimeout time.Duration // Timeout controls the read timeout for each read operation. // Default is defaultReadTimeout. Timeout time.Duration // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.