NO_PROXY describes destinations that should be reached directly. It does not identify proxy servers to avoid. Adding the selected proxy's own IP to the list is not a way to choose whether an unrelated website uses that proxy.

EntryMeaning in curl
example.comThe named domain and matching subdomains bypass the proxy.
.example.comA domain-suffix exclusion, including the domain itself.
192.168.1.10A matching literal destination IP bypasses the proxy.
192.168.0.0/16Matching literal IP destinations bypass it; CIDR support requires curl 7.86.0 or newer.
*Every destination bypasses the proxy.

Empty and asterisk are different

For one explicit proxy test, an empty command-line list removes environment bypass matches:

curl --proxy http://203.0.113.10:8080 --noproxy '' \
  --connect-timeout 5 --max-time 15 https://example.com/

Replace the documentation endpoint with your HTTP proxy or a candidate from the HTTP proxy list. To perform the opposite comparison, the quoted wildcard makes the request direct even though the proxy option is present:

curl --proxy http://203.0.113.10:8080 --noproxy '*' \
  --connect-timeout 5 --max-time 15 https://example.com/

Keep the wildcard quoted so the shell does not expand it into filenames. Unsetting an environment variable, setting it to an empty value, and supplying a command-line override are separate actions; another applicable setting can remain after you remove only one definition.

CIDR is not a rule for every name that resolves into a network

A CIDR entry is matched against an IP address used as the destination host. It is not a general instruction to resolve every hostname first and bypass the proxy if the answer falls inside that network. A URL using a hostname and a URL using its numeric address can therefore select different routes.

Use hostnames or domain suffixes when that is what the URL contains. Do not put a full scheme, path, or browser bypass expression into this list and assume curl will interpret it the same way.

These rules describe curl 8.14.1. Other clients have their own NO_PROXY behavior, including differences in wildcard and port matching.

متعلقہ مضامین