-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Description
Feature request - It would be helpful if the net/http client supported CIDR notation in the no_proxy environment variable, or allowed another way to configure the net/http client to ignore the http_proxy for large networks (ie 10.0.0.0/8 etc).
I had no luck finding an official "spec" for the no_proxy environment variable, but I believe supporting this notation would cause no issues and would allow users of net/http to add proxy exclusions for large networks.
Python requests library implements this feature with the no_proxy env variable - https://github.com/kennethreitz/requests/blob/master/requests/utils.py#L569
and most browsers allow some sort of CIDR notation / wildcards for proxy exclusions.
During my searching, I came across an old issue #2158 where the functionality was discussed but not really addressed (as far as the CIDR notation goes)
- What version of Go are you using (
go version)?
go version go1.6.3 linux/amd64 - What operating system and processor architecture are you using (
go env)?
GOARCH="amd64"
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux" - What did you do?
Tried to use CIDR notation in the no_proxy env variable to exclude net/http client from using web proxy specified in http_proxy env variable for private network 10.0.0.0/8 - What did you expect to see?
Expected http client library to ignore http_proxy for addresses in the 10.0.0.0/8 network. - What did you see instead?
net/http client tried to use the http_proxy for get/post requests to addresses in 10.0.0.0/8 network.
Cheers, and thanks for golang!