Skip to content

Commit e87b0fd

Browse files
author
Ondrej Filip
committed
docs: ip ranges in no_proxy
1 parent 92067fe commit e87b0fd

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

docs/environment_variables.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,20 @@ python -c "import httpx; httpx.get('http://example.com', trust_env=False)"
3636

3737
### `NO_PROXY`
3838

39-
Valid values: a comma-separated list of hostnames/urls
39+
Valid values: a comma-separated list of hostnames/urls/ip ranges
4040

4141
`NO_PROXY` disables the proxy for specific urls
4242

4343
```bash
4444
export HTTP_PROXY=http://my-external-proxy.com:1234
45-
export NO_PROXY=http://127.0.0.1,python-httpx.org
45+
export NO_PROXY=http://127.0.0.0/8,python-httpx.org,::1
4646

4747
# As in the previous example, this request will be sent through the proxy
4848
python -c "import httpx; httpx.get('http://example.com')"
4949

5050
# These requests will be sent directly, bypassing the proxy
51-
python -c "import httpx; httpx.get('http://127.0.0.1:5000/my-api')"
51+
python -c "import httpx; httpx.get('http://127.0.0.10:5000/my-api')"
52+
python -c "import httpx; httpx.get('http://[::1]:5000/my-api')"
5253
python -c "import httpx; httpx.get('https://www.python-httpx.org')"
5354
```
5455

0 commit comments

Comments
 (0)