Skip to content

Commit

Permalink
Pass request context to proxyDialer
Browse files Browse the repository at this point in the history
  • Loading branch information
bdwyertech committed Oct 29, 2022
1 parent d02fd35 commit bbf4078
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions pkg/gontlm-proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,8 @@ func Run() {
}

// HTTPS
proxy.ConnectDial = func(network, addr string) (net.Conn, error) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()

return proxyDialer("https", addr, proxyUrl)(ctx, network, addr)
proxy.ConnectDialWithReq = func(req *http.Request, network, addr string) (net.Conn, error) {
return proxyDialer("https", addr, proxyUrl)(req.Context(), network, addr)
}

//
Expand Down

0 comments on commit bbf4078

Please sign in to comment.