handleHTTP handles plain HTTP proxy requests.
(ctx context.Context, conn net.Conn, req *http.Request)
| 135 | |
| 136 | // handleHTTP handles plain HTTP proxy requests. |
| 137 | func (s *proxyServer) handleHTTP(ctx context.Context, conn net.Conn, req *http.Request) { |
| 138 | req.RequestURI = "" |
| 139 | if req.URL.Scheme == "" { |
| 140 | req.URL.Scheme = "http" |
| 141 | } |
| 142 | s.proxyAndRecord(ctx, conn, req, "http") |
| 143 | } |
| 144 | |
| 145 | // proxyAndRecord forwards the request, records the exchange, and writes the response back. |
| 146 | func (s *proxyServer) proxyAndRecord(ctx context.Context, w io.Writer, req *http.Request, scheme string) { |
no test coverage detected