MCPcopy Create free account
hub / github.com/buggregator/server / handleConn

Method handleConn

modules/proxy/server.go:75–89  ·  view source on GitHub ↗
(ctx context.Context, conn net.Conn)

Source from the content-addressed store, hash-verified

73}
74
75func (s *proxyServer) handleConn(ctx context.Context, conn net.Conn) {
76 defer conn.Close()
77
78 br := bufio.NewReader(conn)
79 req, err := http.ReadRequest(br)
80 if err != nil {
81 return
82 }
83
84 if req.Method == http.MethodConnect {
85 s.handleConnect(ctx, conn, req)
86 } else {
87 s.handleHTTP(ctx, conn, req)
88 }
89}
90
91// handleConnect handles HTTPS CONNECT tunneling with MITM.
92func (s *proxyServer) handleConnect(ctx context.Context, conn net.Conn, connectReq *http.Request) {

Callers 1

StartMethod · 0.95

Calls 2

handleConnectMethod · 0.95
handleHTTPMethod · 0.95

Tested by

no test coverage detected