From: nyuszika7h Date: Thu, 5 May 2022 12:11:18 +0000 (+0200) Subject: docs: Fix proxy examples (#2183) X-Git-Tag: 0.23.0~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=782f507b634d58394c1e9043231f891644637638;p=thirdparty%2Fhttpx.git docs: Fix proxy examples (#2183) Per https://www.python-httpx.org/compatibility/#proxy-keys, there should always be a `://` after the protocol. The given examples raise an exception when used as-is. Co-authored-by: Florimond Manca Co-authored-by: Tom Christie --- diff --git a/docs/contributing.md b/docs/contributing.md index 74472575..1d44616f 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -213,7 +213,7 @@ this is where our previously generated `client.pem` comes in: ``` import httpx -proxies = {"all": "http://127.0.0.1:8080/"} +proxies = {"all://": "http://127.0.0.1:8080/"} with httpx.Client(proxies=proxies, verify="/path/to/client.pem") as client: response = client.get("https://example.org") diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 64615749..459f744e 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -20,8 +20,8 @@ httpx.ProxyError: _ssl.c:1091: The handshake operation timed out ```python proxies = { - "http": "http://myproxy.org", - "https": "https://myproxy.org", + "http://": "http://myproxy.org", + "https://": "https://myproxy.org", } ``` @@ -33,8 +33,8 @@ Change the scheme of your HTTPS proxy to `http://...` instead of `https://...`: ```python proxies = { - "http": "http://myproxy.org", - "https": "http://myproxy.org", + "http://": "http://myproxy.org", + "https://": "http://myproxy.org", } ```