goproxy
goproxy copied to clipboard
CONNECT response headers
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
})