MCPcopy Create free account
hub / github.com/celzero/midway / StartPPWithDoTCleartext

Function StartPPWithDoTCleartext

midway/server.go:168–189  ·  view source on GitHub ↗
(tcp *proxyproto.Listener, doh DohResolver, wg *sync.WaitGroup)

Source from the content-addressed store, hash-verified

166}
167
168func StartPPWithDoTCleartext(tcp *proxyproto.Listener, doh DohResolver, wg *sync.WaitGroup) {
169 defer wg.Done()
170
171 if tcp == nil {
172 log.Print("Exiting pp dot")
173 return
174 }
175
176 log.Print("mode: DoT cleartext ", tcp.Addr().String())
177 // ref: github.com/miekg/dns/blob/dedee46/server.go#L192
178 // usage: github.com/folbricht/routedns/blob/7b8e284/dotlistener.go#L29
179 dnsserver := &dns.Server{
180 Net: "tcp", // unused
181 Listener: tcp,
182 MaxTCPQueries: int(maxInflightQueries),
183 Handler: doh.DnsHandler(),
184 }
185
186 // ref: github.com/miekg/dns/blob/dedee46/server.go#L133
187 err := dnsserver.ActivateAndServe()
188 log.Print("exit dot cleartext:", err)
189}

Callers 1

mainFunction · 0.92

Calls 2

AddrMethod · 0.80
DnsHandlerMethod · 0.65

Tested by

no test coverage detected