The Fix
Upgrade to version 0.21.2 or later.
Based on closed encode/httpx issue #1992 · PR/commit linked
Production note: Most teams hit this during upgrades or environment changes. Roll out with a canary and smoke critical endpoints (health, OpenAPI/docs) before 100%.
@@ -138,19 +138,36 @@ def __init__(
)
else:
- self._pool = httpcore.HTTPProxy(
- proxy_url=httpcore.URL(
- scheme=proxy.url.raw_scheme,
Name: httpx
Version: 0.21.1
Summary: The next generation HTTP client.
Home-page: https://github.com/encode/httpx
Author: Tom Christie
Author-email: [email protected]
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Option A — Upgrade to fixed release\nUpgrade to version 0.21.2 or later.\nWhen NOT to use: This fix should not be used if the application requires strict HTTP/1 behavior.\n\n
Why This Fix Works in Production
- Trigger: Same problem in httpx 0.21.1. I try the socks5 and http proxy, and they all failed. But I can get normal http2 response via Chrome using proxy. So weird.
- Mechanism: The library did not support HTTP/2 for requests made through proxies
- Why the fix works: Adds HTTP/2 support for tunnelled proxy cases, addressing the issue where requests downgrade to HTTP/1 when using a proxy. (first fixed release: 0.21.2).
- If left unfixed, the same config can fail only in production (env differences), causing startup failures or partial feature outages.
Why This Breaks in Prod
- The library did not support HTTP/2 for requests made through proxies
- Production symptom (often without a traceback): Same problem in httpx 0.21.1. I try the socks5 and http proxy, and they all failed. But I can get normal http2 response via Chrome using proxy. So weird.
Proof / Evidence
- GitHub issue: #1992
- Fix PR: https://github.com/encode/httpx/pull/2009
- First fixed release: 0.21.2
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.85
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.69
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“Same problem in httpx 0.21.1. I try the socks5 and http proxy, and they all failed. But I can get normal http2 response via Chrome…”
“@yofeng2021 Yes, same with me. I was able to load proxy via chrome and the request went through HTTP/2. I think the issue stands with…”
Failure Signature (Search String)
- Same problem in httpx 0.21.1. I try the socks5 and http proxy, and they all failed. But I can get normal http2 response via Chrome using proxy. So weird.
Copy-friendly signature
Failure Signature
-----------------
Same problem in httpx 0.21.1. I try the socks5 and http proxy, and they all failed. But I can get normal http2 response via Chrome using proxy. So weird.
Error Message
Signature-only (no traceback captured)
Error Message
-------------
Same problem in httpx 0.21.1. I try the socks5 and http proxy, and they all failed. But I can get normal http2 response via Chrome using proxy. So weird.
Minimal Reproduction
Name: httpx
Version: 0.21.1
Summary: The next generation HTTP client.
Home-page: https://github.com/encode/httpx
Author: Tom Christie
Author-email: [email protected]
Environment
- httpx: 0.21.1
What Broke
Requests downgraded to HTTP/1 when using a proxy, causing performance issues.
Why It Broke
The library did not support HTTP/2 for requests made through proxies
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
Upgrade to version 0.21.2 or later.
Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.
Fix reference: https://github.com/encode/httpx/pull/2009
First fixed release: 0.21.2
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- This fix should not be used if the application requires strict HTTP/1 behavior.
Verify Fix
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Did This Fix Work in Your Case?
Quick signal helps us prioritize which fixes to verify and improve.
Prevention
- Add a CI check that diffs key outputs after upgrades (OpenAPI schema snapshots, JSON payload shapes, CLI output).
- Upgrade behind a canary and run integration tests against the canary before 100% rollout.
Version Compatibility Table
| Version | Status |
|---|---|
| 0.21.2 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.