Skip to content

Commit dae0f1b

Browse files
committed
chore: fix http.Transport deprecation
`http.Transport.Dial` has been deprecated since Go 1.7
1 parent 1dce4a5 commit dae0f1b

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy