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

Function StartPP

midway/server.go:109–132  ·  view source on GitHub ↗
(tcp *proxyproto.Listener, wg *sync.WaitGroup)

Source from the content-addressed store, hash-verified

107}
108
109func StartPP(tcp *proxyproto.Listener, wg *sync.WaitGroup) {
110 defer wg.Done()
111
112 if tcp == nil {
113 log.Print("Exiting pp tcp")
114 return
115 }
116
117 defer tcp.Close()
118
119 for {
120 if conn, err := tcp.Accept(); err == nil {
121 if _, ok := accept(conn); !ok {
122 log.Print("cannot accept conn")
123 }
124 } else {
125 log.Print("handle pp tcp err")
126 if errors.Is(err, net.ErrClosed) {
127 log.Print(err)
128 return
129 }
130 }
131 }
132}
133
134// ref: github.com/thrawn01/h2c-golang-example
135func StartPPWithDoHCleartext(tcp *proxyproto.Listener, doh DohResolver, wg *sync.WaitGroup) {

Callers 3

mainFunction · 0.92
StartPPWithDoHFunction · 0.85
StartPPWithDoTFunction · 0.85

Calls 3

acceptFunction · 0.85
AcceptMethod · 0.80
CloseMethod · 0.45

Tested by

no test coverage detected