github.com/cloudfoundry-attic/ltc@v0.0.0-20151123212628-098adc7919fc/receptor_client/receptor_client.go (about) 1 package receptor_client 2 3 import ( 4 "net/http" 5 6 "github.com/cloudfoundry-incubator/receptor" 7 ) 8 9 //go:generate counterfeiter -o fake_receptor_client_creator/fake_receptor_client_creator.go . Creator 10 type Creator interface { 11 CreateReceptorClient(target string) receptor.Client 12 } 13 14 type ProxyAwareCreator struct{} 15 16 func (ProxyAwareCreator) CreateReceptorClient(target string) receptor.Client { 17 receptorClient := receptor.NewClient(target) 18 19 transport := receptorClient.GetClient().Transport 20 httpTransport := transport.(*http.Transport) 21 httpTransport.Proxy = http.ProxyFromEnvironment 22 receptorClient.GetClient().Transport = httpTransport 23 24 return receptorClient 25 }