From c48954c0b91bd269ad1beb8cd39a9ccbb595753c Mon Sep 17 00:00:00 2001 From: Kevin Downey Date: Tue, 26 Nov 2024 15:33:04 -0800 Subject: [PATCH] support proxy setting from env vars Support HTTP_PROXY, HTTPS_PROXY or NO_PROXY being set as environment variables. e.g., `export HTTPS_PROXY=http://127.0.0.1:38080` --- pkg/client/load.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/client/load.go b/pkg/client/load.go index c4c71d8..966ee45 100644 --- a/pkg/client/load.go +++ b/pkg/client/load.go @@ -102,6 +102,7 @@ func (c *Cassowary) runLoadTest(outPutChan chan<- durationMetrics, workerChan ch } request = request.WithContext(httptrace.WithClientTrace(context.Background(), trace)) + c.Client.Transport.(*http.Transport).Proxy = http.ProxyFromEnvironment resp, err := c.Client.Do(request) if err != nil { log.Fatalf("%v", err)