goproxy icon indicating copy to clipboard operation
goproxy copied to clipboard

CONNECT response headers

Open alaingilbert opened this issue 3 years ago • 0 comments

I'm using a MITM proxy that itself connect to another proxy and I'm trying to get the response headers received from the CONNECT request.

I currently set the proxy transport in the proxy.OnRequest().HandleConnectFunc(...) But I would need something like proxy.OnResponse().HandleConnectFunc(...) to get the response headers.

Is there any way to do this ?


proxyServer.OnRequest().HandleConnectFunc(func(host string, ctx *goproxy.ProxyCtx) (*goproxy.ConnectAction, string) {
  proxyServer.Tr = &http.Transport{
    Proxy:           http.ProxyURL(proxyUrl),
    TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
  }
  return goproxy.MitmConnect, host
})

alaingilbert avatar Jan 14 '21 10:01 alaingilbert