rendezvous / BrokerChannel tests for client

This commit is contained in:
Serene Han 2016-02-27 14:45:53 -08:00
parent 5edac195f6
commit 5aae41c901
2 changed files with 63 additions and 5 deletions

View file

@ -18,9 +18,10 @@ import (
type BrokerChannel struct {
// The Host header to put in the HTTP request (optional and may be
// different from the host name in URL).
Host string
url *url.URL
transport http.Transport // Used to make all requests.
Host string
url *url.URL
// transport http.Transport // Used to make all requests.
transport http.RoundTripper // Used to make all requests.
}
// Construct a new BrokerChannel, where:
@ -41,8 +42,9 @@ func NewBrokerChannel(broker string, front string) *BrokerChannel {
// We make a copy of DefaultTransport because we want the default Dial
// and TLSHandshakeTimeout settings. But we want to disable the default
// ProxyFromEnvironment setting.
bc.transport = *http.DefaultTransport.(*http.Transport)
bc.transport.Proxy = nil
transport := http.DefaultTransport.(*http.Transport)
transport.Proxy = nil
bc.transport = transport
return bc
}