MCPcopy
hub / github.com/AdguardTeam/dnsproxy / dnsCrypt

Struct dnsCrypt

upstream/dnscrypt.go:19–40  ·  view source on GitHub ↗

dnsCrypt implements the [Upstream] interface for the DNSCrypt protocol.

Source from the content-addressed store, hash-verified

17
18// dnsCrypt implements the [Upstream] interface for the DNSCrypt protocol.
19type dnsCrypt struct {
20 // mu protects client and serverInfo.
21 mu *sync.RWMutex
22
23 // client stores the DNSCrypt client properties.
24 client *dnscrypt.Client
25
26 // resolverInfo stores the DNSCrypt server properties.
27 resolverInfo *dnscrypt.ResolverInfo
28
29 // addr is the DNSCrypt server URL.
30 addr *url.URL
31
32 // logger is used for exchange logging. It is never nil.
33 logger *slog.Logger
34
35 // verifyCert is a callback that verifies the resolver's certificate.
36 verifyCert func(cert *dnscrypt.Certificate) (err error)
37
38 // timeout is the timeout for the DNS requests.
39 timeout time.Duration
40}
41
42// newDNSCrypt returns a new DNSCrypt Upstream.
43func newDNSCrypt(addr *url.URL, opts *Options) (u *dnsCrypt) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected