Skip to content
Myr

Add documentation for host-specific proxies

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Jason Grout · committed by Jason Grout · parent 48fe344 · Browse files · 1 file+6 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−0 removed

  • other:+6 added−0 removed

1 file+6 added−0 removed

modified:docs/user/advanced.rst+6 added
457 unmodified lines
458459 import requests460461 proxies = {462 "http://10.20.1.128": "http://10.10.1.10:5323",463 "https://10.20.1.140": "http://10.10.1.10:6431"464 "http": "http://10.10.1.10:3128",465 "https": "http://10.10.1.10:1080",466 }467468 requests.get("http://example.org", proxies=proxies)469470A request's ``<scheme>://<hostname>`` is looked up in the proxies471dictionary first, to provide host-specific proxies. If no472host-specific proxy is found, the request's scheme is looked up.473474You can also configure proxies by setting the environment variables475``HTTP_PROXY`` and ``HTTPS_PROXY``.476477::
392 unmodified lines