Skip to content

Commit

Permalink
docs: Fix proxy examples (#2183)
Browse files Browse the repository at this point in the history
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 <florimond.manca@protonmail.com>
Co-authored-by: Tom Christie <tom@tomchristie.com>
  • Loading branch information
3 people committed May 5, 2022
1 parent 8bdd673 commit 782f507
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
8 changes: 4 additions & 4 deletions docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
```

Expand All @@ -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",
}
```

Expand Down

0 comments on commit 782f507

Please sign in to comment.