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

Function accept

midway/server.go:31–42  ·  view source on GitHub ↗
(c net.Conn)

Source from the content-addressed store, hash-verified

29)
30
31func accept(c net.Conn) (net.Conn, bool) {
32 d := relay.NewProxyConn(c)
33 // if the incoming sni == our dns-server, then serve the req
34 for i := range tlsDNSNames {
35 if strings.Contains(d.HostName, tlsDNSNames[i]) {
36 return d, false
37 }
38 }
39 // else, proxy the request to the backend as approp
40 go d.Forward()
41 return d, true
42}
43
44func StartPPWithDoH(tcp *proxyproto.Listener, doh DohResolver, wg *sync.WaitGroup) {
45 defer wg.Done()

Callers 1

StartPPFunction · 0.85

Calls 2

NewProxyConnFunction · 0.92
ForwardMethod · 0.80

Tested by

no test coverage detected