From 3fa9ddd1e129333768e49501c856c1e70eeff339 Mon Sep 17 00:00:00 2001 From: Brendan Burns Date: Tue, 10 Feb 2015 05:19:54 -0800 Subject: [PATCH] Add an (optional) proxy to the TLS config. Also fill in some other reasonable defaults. --- pkg/client/helper.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/client/helper.go b/pkg/client/helper.go index 560e959ef3..91c2151d8b 100644 --- a/pkg/client/helper.go +++ b/pkg/client/helper.go @@ -19,6 +19,7 @@ package client import ( "fmt" "io/ioutil" + "net" "net/http" "net/url" "os" @@ -26,6 +27,7 @@ import ( "reflect" gruntime "runtime" "strings" + "time" "github.com/GoogleCloudPlatform/kubernetes/pkg/api/latest" "github.com/GoogleCloudPlatform/kubernetes/pkg/runtime" @@ -228,6 +230,12 @@ func TransportFor(config *Config) (http.RoundTripper, error) { if tlsConfig != nil { transport = &http.Transport{ TLSClientConfig: tlsConfig, + Proxy: http.ProxyFromEnvironment, + Dial: (&net.Dialer{ + Timeout: 30 * time.Second, + KeepAlive: 30 * time.Second, + }).Dial, + TLSHandshakeTimeout: 10 * time.Second, } } else { transport = http.DefaultTransport