when action is ConnectHTTPMitm, the CONNECT tunnel is not terminator
Author: kychengCreated Oct 29, 2025Updated Jan 13, 2026
When using ConnectHTTPMitm, the client does not use the keep-alive parameter when connecting to the proxy.
The client uses CONNECT to connect to the proxy and then initiates an HTTP request. After the proxy processes the request and writes the response to the client, it waits for the next request.
Because the response does not include Content-Length or Transfer-Encoding, the client does not know whether the response has ended and then enters a waiting state.
The entire workflow gets stuck.
Additionally, I noticed that the client includes Connection: close when sending the request. After processing a request, should ConnectHTTPMitm close the tunnel?
Source: elazarl/goproxy