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

Method newDNSCryptServer

proxy/serverdnscrypt.go:88–106  ·  view source on GitHub ↗

newDNSCryptServer returns a new DNSCrypt server for the given address and protocol.

(
	ctx context.Context,
	addr netip.AddrPort,
	proto dnscrypt.Proto,
)

Source from the content-addressed store, hash-verified

86// newDNSCryptServer returns a new DNSCrypt server for the given address and
87// protocol.
88func (p *Proxy) newDNSCryptServer(
89 ctx context.Context,
90 addr netip.AddrPort,
91 proto dnscrypt.Proto,
92) (s *dnscrypt.Server, err error) {
93 p.logger.InfoContext(ctx, "creating dnscrypt server", "addr", addr, "proto", proto)
94
95 return dnscrypt.NewServer(&dnscrypt.ServerConfig{
96 Handler: &dnsCryptHandler{
97 proxy: p,
98 reqSema: p.requestsSema,
99 },
100 ResolverCert: p.DNSCryptResolverCert,
101 Logger: p.logger,
102 ProviderName: p.DNSCryptProviderName,
103 Addr: addr,
104 Proto: proto,
105 })
106}
107
108// dnsCryptHandler is the [dnscrypt.Handler] implementation that handles
109// requests in the Proxy.

Callers 1

initDNSCryptServersMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected