From 73504dca4193faebda444b18486270a7974b4cf3 Mon Sep 17 00:00:00 2001 From: Brian Waldon Date: Tue, 23 Sep 2014 10:32:21 -0700 Subject: [PATCH] proxy: determine scheme based on TLSClientConfig --- proxy/proxy.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/proxy/proxy.go b/proxy/proxy.go index a162c5cd0..80ae38be9 100644 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -5,7 +5,12 @@ import ( ) func NewHandler(t *http.Transport, addrs []string) (http.Handler, error) { - d, err := newDirector("http", addrs) + scheme := "http" + if t.TLSClientConfig != nil { + scheme = "https" + } + + d, err := newDirector(scheme, addrs) if err != nil { return nil, err }