10000 Merge pull request #608 from tucksaun/chore/http-transport-deprecation · symfony-cli/symfony-cli@8bd9fcd · GitHub
[go: up one dir, main page]

Skip to content

Commit 8bd9fcd

Browse files
authored
Merge pull request #608 from tucksaun/chore/http-transport-deprecation
chore: fix http.Transport deprecation
2 parents 594009a + dae0f1b commit 8bd9fcd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

local/proxy/proxy.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ func tlsToLocalWebServer(proxy *goproxy.ProxyHttpServer, tlsConfig *tls.Config,
5454
ctx.Warnf("Error closing client connection: %s", err)
5555
}
5656
}
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 {
5959
return proxy.ConnectDial(network, addr)
6060
}
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)
6363
}
6464
return net.Dial(network, addr)
6565
}
@@ -91,7 +91,7 @@ func tlsToLocalWebServer(proxy *goproxy.ProxyHttpServer, tlsConfig *tls.Config,
9191
}
9292

9393
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))
9595
if err != nil {
9696
httpError(proxyClientTls, ctx, err)
9797
if targetSiteCon != nil {

0 commit comments

Comments
 (0)
0