Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TLSPool ¶
type TLSPool struct {
// contains filtered or unexported fields
}
TLSPool is a connections pool for the DNS-over-TLS Upstream.
Example:
pool := TLSPool{Address: "tls://1.1.1.1:853"} netConn, err := pool.Get() if err != nil {panic(err)} c := dns.Conn{Conn: netConn} q := dns.Msg{} q.SetQuestion("google.com.", dns.TypeA) log.Println(q) err = c.WriteMsg(&q) if err != nil {panic(err)} r, err := c.ReadMsg() if err != nil {panic(err)} log.Println(r) pool.Put(c.Conn)
func (*TLSPool) Create ¶ added in v0.9.10
Create creates a new connection for the pool (but not puts it there)
type Upstream ¶
Upstream is an interface for a DNS resolver
func AddressToUpstream ¶
AddressToUpstream converts the specified address to an Upstream instance * 8.8.8.8:53 -- plain DNS * tcp://8.8.8.8:53 -- plain DNS over TCP * tls://1.1.1.1 -- DNS-over-TLS * https://dns.adguard.com/dns-query -- DNS-over-HTTPS * sdns://... -- DNS stamp (see https://dnscrypt.info/stamps-specifications) bootstrap is a plain DNS which is used to resolve DoH/DoT hostnames (if any) timeout is a default upstream timeout. Also, it is used as a timeout for bootstrap DNS requests. timeout=0 means infinite timeout