Skip to content
Myr

Reword documentation for per-host 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 56844d1 · Browse files · 1 file+8 added−7 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+8 added−7 removed

  • other:+8 added−7 removed

1 file+8 added−7 removed

modified:docs/user/advanced.rst+8 added-7 removed
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"462 "http": "http://10.10.1.10:3128",463 "https": "http://10.10.1.10:1080",464 }465466 requests.get("http://example.org", proxies=proxies)467470A 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.473468You can also configure proxies by setting the environment variables469``HTTP_PROXY`` and ``HTTPS_PROXY``.470471::
9 unmodified lines
481 proxies = {482 "http": "http://user:pass@10.10.1.10:3128/",483 }484491Note that proxy URLs must include the scheme.485To give a proxy for a specific scheme and host, use the486`scheme://host` form for the key::487488 proxies = {489 "http://10.20.1.128": "http://10.10.1.10:5323",490 }491492Note that proxy URLs must include the scheme.493 494.. _compliance:495496Compliance497----------
373 unmodified lines