Skip to content

Commit

Permalink
Clean up dialer logic
Browse files Browse the repository at this point in the history
  • Loading branch information
bdwyertech committed Mar 5, 2021
1 parent 83a6004 commit 55b6755
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions pkg/gontlm-proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,18 @@ func Run() {
//
// Proxy Dialer
//
dialer := func(network, addr string) (net.Conn, error) {
proxy.Tr.DialContext = proxyplease.NewDialContext(proxyplease.Proxy{
URL: proxyUrl,
Username: ProxyUser,
Password: ProxyPass,
Domain: ProxyDomain,
})
proxy.ConnectDial = func(network, addr string) (net.Conn, error) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
return proxyplease.NewDialContext(proxyplease.Proxy{
URL: proxyUrl,
Username: ProxyUser,
Password: ProxyPass,
Domain: ProxyDomain,
})(ctx, network, addr)
return proxy.Tr.DialContext(ctx, network, addr)
}
proxy.ConnectDial = dialer
proxy.Tr.Dial = dialer

proxy.Tr.Proxy = nil

//
Expand Down

0 comments on commit 55b6755

Please sign in to comment.