@@ -54,12 +54,12 @@ func tlsToLocalWebServer(proxy *goproxy.ProxyHttpServer, tlsConfig *tls.Config,
54
54
ctx .Warnf ("Error closing client connection: %s" , err )
55
55
}
56
56
}
57
- connectDial := func (proxy * goproxy.ProxyHttpServer , network , addr string ) (c net.Conn , err error ) {
58
- if proxy .ConnectDial != nil {
57
+ connectDial := func (ctx * goproxy.ProxyCtx , network , addr string ) (c net.Conn , err error ) {
58
+ if ctx . Proxy .ConnectDial != nil {
59
59
return proxy .ConnectDial (network , addr )
60
60
}
61
- if proxy . Tr .Dial != nil {
62
- return proxy .Tr .Dial ( network , addr )
61
+ if ctx . Proxy . Tr .DialContext != nil {
62
+ return proxy .Tr .DialContext ( ctx . Req . Context (), network , addr )
63
63
}
64
64
return net .Dial (network , addr )
65
65
}
@@ -91,7 +91,7 @@ func tlsToLocalWebServer(proxy *goproxy.ProxyHttpServer, tlsConfig *tls.Config,
91
91
}
92
92
93
93
ctx .Logf ("Assuming CONNECT is TLS, TLS proxying it" )
94
- targetSiteCon , err := connectDial (proxy , "tcp" , fmt .Sprintf ("127.0.0.1:%d" , localPort ))
94
+ targetSiteCon , err := connectDial (ctx , "tcp" , fmt .Sprintf ("127.0.0.1:%d" , localPort ))
95
95
if err != nil {
96
96
httpError (proxyClientTls , ctx , err )
97
97
if targetSiteCon != nil {
0 commit comments