Open skiloop opened 6 years ago
after monitor network traffic, I found not Proxy-Authorization in headers fields of the CONNECT method to downstream proxy. I changed a few lines of function Proxy.connect to:
pbw := bufio.NewWriter(conn)
pbr := bufio.NewReader(conn)
if p.proxyURL.User != nil {
req.Header.Add("Proxy-Authorization", "Basic "+base64.StdEncoding.EncodeToString([]byte(p.proxyURL.User.String())))
}
req.Write(pbw)
pbw.Flush()
and this results stucking at tls handshakes
The problem may be the usage of http.ReadResponse for CONNECT
res, err := http.ReadResponse(pbr, req)
When it write response back, "Connection: close" is added automatically.
My remote proxy which is password protected and supports https, when applies to martian as downstream proxy, 407 is got.
then comes the following result: