[VOL-2312] Logging - Integrate voltctl with new etcd-based dynamic loglevel mechanism. Testing is in progress
Change-Id: I2e13bb79008c9a49ebb6f58e575f51efebe6dbfd
diff --git a/vendor/golang.org/x/net/proxy/proxy.go b/vendor/golang.org/x/net/proxy/proxy.go
index f6026b9..9ff4b9a 100644
--- a/vendor/golang.org/x/net/proxy/proxy.go
+++ b/vendor/golang.org/x/net/proxy/proxy.go
@@ -15,6 +15,7 @@
)
// A Dialer is a means to establish a connection.
+// Custom dialers should also implement ContextDialer.
type Dialer interface {
// Dial connects to the given address via the proxy.
Dial(network, addr string) (c net.Conn, err error)
@@ -25,21 +26,30 @@
User, Password string
}
-// FromEnvironment returns the dialer specified by the proxy related variables in
-// the environment.
+// FromEnvironment returns the dialer specified by the proxy-related
+// variables in the environment and makes underlying connections
+// directly.
func FromEnvironment() Dialer {
+ return FromEnvironmentUsing(Direct)
+}
+
+// FromEnvironmentUsing returns the dialer specify by the proxy-related
+// variables in the environment and makes underlying connections
+// using the provided forwarding Dialer (for instance, a *net.Dialer
+// with desired configuration).
+func FromEnvironmentUsing(forward Dialer) Dialer {
allProxy := allProxyEnv.Get()
if len(allProxy) == 0 {
- return Direct
+ return forward
}
proxyURL, err := url.Parse(allProxy)
if err != nil {
- return Direct
+ return forward
}
- proxy, err := FromURL(proxyURL, Direct)
+ proxy, err := FromURL(proxyURL, forward)
if err != nil {
- return Direct
+ return forward
}
noProxy := noProxyEnv.Get()
@@ -47,7 +57,7 @@
return proxy
}
- perHost := NewPerHost(proxy, Direct)
+ perHost := NewPerHost(proxy, forward)
perHost.AddFromString(noProxy)
return perHost
}