Skip to content

Commit 76c9ead

Browse files
authored
Allow usage of HTTP_PROXY and HTTPS_PROXY. (#216)
These variables are supported if the default `http.Client` and `http.Transport` are used, but due to custom instances being used, the support is lost. This commit manually adds it back.
1 parent e355106 commit 76c9ead

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
Order should be `CHANGE`, `FEATURE`, `ENHANCEMENT`, and `BUGFIX`
44

5+
## unreleased
6+
7+
* [ENHANCEMENT] Allow usage of HTTP_PROXY and HTTPS_PROXY. #216
8+
59
## v0.10.4
610

711
* [CHANGE] Update go image to v1.16.8. #213

pkg/client/client.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ func New(cfg Config) (*CortexClient, error) {
7272
}
7373

7474
if tlsConfig != nil {
75-
transport := &http.Transport{TLSClientConfig: tlsConfig}
75+
transport := &http.Transport{
76+
Proxy: http.ProxyFromEnvironment,
77+
TLSClientConfig: tlsConfig,
78+
}
7679
client = http.Client{Transport: transport}
7780
}
7881

0 commit comments

Comments
 (0)