Skip to content

Support CIDR blocks in NO_PROXY env variable #2878

Closed
@melkouri

Description

@melkouri

Is your feature request related to a problem? Please describe.

We have use cases where we would like to block all private IPs, hostnames using the NO_PROXY env variable. We want to specify whole CIDR blocks rather than whitelist each single IP, for example (NO_PROXY=172.16.0.0/12, 192.168.0.0/16).

Today the library only supports the NO_PROXY to be a list of single IPs (NO_PROXY=172.16.0.10, 192.168.0.10) and checks the host we're reaching against the list.

Describe the solution you'd like

In other languages

  • Golang: according to the documentation for http.ProxyFromEnvironment, the NO_PROXY environment variable does not natively support CIDR blocks. Instead, it only supports exact hostnames or IP addresses (optionally including ports).
  • C-core supports using CIDR blocks in NO_PROXY(implementation) (doc)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions