diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-02-04 08:53:42 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-04 08:53:42 -0500 |
commit | 320e2935c8468b21a3ce6dee1b5201c2ed3f738a (patch) | |
tree | fd4078e58bc9ab0b6c2ef1938017ce5844f97744 /vendor/github.com/docker/go-connections/sockets/proxy.go | |
parent | 608b6142edb7a4e179ce6d2ae69707be28f29359 (diff) | |
parent | 1d1b2b1509646e07ab4a984c7622fa002a0fcdb7 (diff) | |
download | podman-320e2935c8468b21a3ce6dee1b5201c2ed3f738a.tar.gz podman-320e2935c8468b21a3ce6dee1b5201c2ed3f738a.tar.bz2 podman-320e2935c8468b21a3ce6dee1b5201c2ed3f738a.zip |
Merge pull request #13136 from rhatdan/VENDOR
Update containers/buildah v1.24.1
Diffstat (limited to 'vendor/github.com/docker/go-connections/sockets/proxy.go')
-rw-r--r-- | vendor/github.com/docker/go-connections/sockets/proxy.go | 39 |
1 files changed, 8 insertions, 31 deletions
diff --git a/vendor/github.com/docker/go-connections/sockets/proxy.go b/vendor/github.com/docker/go-connections/sockets/proxy.go index 98e9a1dc6..c897cb02a 100644 --- a/vendor/github.com/docker/go-connections/sockets/proxy.go +++ b/vendor/github.com/docker/go-connections/sockets/proxy.go @@ -2,11 +2,8 @@ package sockets import ( "net" - "net/url" "os" "strings" - - "golang.org/x/net/proxy" ) // GetProxyEnv allows access to the uppercase and the lowercase forms of @@ -20,32 +17,12 @@ func GetProxyEnv(key string) string { return proxyValue } -// DialerFromEnvironment takes in a "direct" *net.Dialer and returns a -// proxy.Dialer which will route the connections through the proxy using the -// given dialer. -func DialerFromEnvironment(direct *net.Dialer) (proxy.Dialer, error) { - allProxy := GetProxyEnv("all_proxy") - if len(allProxy) == 0 { - return direct, nil - } - - proxyURL, err := url.Parse(allProxy) - if err != nil { - return direct, err - } - - proxyFromURL, err := proxy.FromURL(proxyURL, direct) - if err != nil { - return direct, err - } - - noProxy := GetProxyEnv("no_proxy") - if len(noProxy) == 0 { - return proxyFromURL, nil - } - - perHost := proxy.NewPerHost(proxyFromURL, direct) - perHost.AddFromString(noProxy) - - return perHost, nil +// DialerFromEnvironment was previously used to configure a net.Dialer to route +// connections through a SOCKS proxy. +// DEPRECATED: SOCKS proxies are now supported by configuring only +// http.Transport.Proxy, and no longer require changing http.Transport.Dial. +// Therefore, only sockets.ConfigureTransport() needs to be called, and any +// sockets.DialerFromEnvironment() calls can be dropped. +func DialerFromEnvironment(direct *net.Dialer) (*net.Dialer, error) { + return direct, nil } |