httpx-socks
Proxy (HTTP, SOCKS) transports for httpx
What it is and what it does
httpx-socks bridges the httpx HTTP client library with SOCKS proxy protocols (SOCKS4, SOCKS4a, SOCKS5, SOCKS5h) and HTTP CONNECT proxies by providing drop-in transport classes. It wraps python-socks for the core proxy logic and exposes SyncProxyTransport and AsyncProxyTransport that integrate directly into httpx's Client and AsyncClient.
The package supports both synchronous and asynchronous workflows. Sync mode works out of the box; async mode requires optional extras for asyncio (with async-timeout) or trio support. It also offers experimental secure proxy connections via SSL context configuration. Typical use is instantiating a transport from a proxy URL, then passing it to an httpx client to route all requests through that proxy.
Use it for:
- Route httpx requests through a SOCKS5 proxy server for anonymity or network isolation.
- Implement async HTTP clients that tunnel through corporate HTTP CONNECT proxies.
- Test web applications behind proxy-only network access by injecting a proxy transport into httpx.
- Build multi-protocol proxy support (SOCKS4/5 and HTTP) in a single client without managing multiple libraries.
- Secure proxy connections with custom SSL verification for encrypted proxy tunnels.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Adds SOCKS4(a), SOCKS5(h), and HTTP CONNECT proxy support to httpx via custom transport classes for both synchronous and asynchronous clients.
Yes. Active maintenance, no known vulnerabilities, low install friction, and permissive license. Install if you need httpx to route through SOCKS or HTTP CONNECT proxies. Use the base package for sync-only; add [asyncio] or [trio] extras if you need async support. The experimental secure proxy feature may warrant testing before production use.
Install
httpx-socks on PyPI
pip
pip install httpx-socksuv
uv add httpx-sockspoetry
poetry add httpx-socksInstalling httpx-socks
Before you install
Low friction: pure Python wheel with four runtime dependencies (httpx, httpcore, python-socks, sniffio). Active maintenance as of 2026-08-14 with recent release. Optional extras for asyncio and trio support available.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions.
Quickstart
pip install httpx-socks
import httpx
from httpx_socks import SyncProxyTransport
transport = SyncProxyTransport.from_url('socks5://user:password@127.0.0.1:1080')
with httpx.Client(transport=transport) as client:
res = client.get('http://example.com')
print(res.text)
Requires Python >= 3.9 and httpx>=0.28.0,<0.29.0; async support requires optional extras (asyncio or trio).
Verify before relying
- Whether secure proxy connections (proxy_ssl parameter) are production-ready or remain experimental.
- Performance characteristics when routing high-volume traffic through SOCKS proxies.
- Compatibility with proxy servers that require specific authentication schemes beyond basic user:password.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — httpx, httpcore, python-socks, sniffio |
| Maintenance | actively maintained — 0 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,013,511/month — #4,507 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: httpx_socks-0.13.1-py3-none-any.whl
Keywords: httpx, socks, socks5, socks4, http, proxy, asyncio, trio, anyio
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
httpx-retriesAdds automatic request retry logic to HTTPX,…
permissive · top 5,000 on PyPI
python-socksProvides SOCKS4(a), SOCKS5(h), and HTTP CONNECT…
permissive · top 5,000 on PyPI
httpx-aiohttpProvides aiohttp-based transports for httpx,…
unclear · top 5,000 on PyPI
pproxypproxy is an asynchronous proxy server that…
permissive · top 15,000 on PyPI
aiohttp_socksProvides a proxy connector for aiohttp that…
permissive · top 5,000 on PyPI
websockets-proxyEnables WebSocket connections through HTTP and…
permissive · top 15,000 on PyPI
socksioSocksio is a sans-I/O SOCKS protocol…
permissive · top 1,000 on PyPI
asysocksAsynchronous SOCKS5, SOCKS4, and HTTP proxy…
permissive · top 15,000 on PyPI
PySocksPySocks provides a SOCKS and HTTP proxy client…
permissive · top 1,000 on PyPI
httpcore2A minimal, low-level HTTP client library…
permissive · top 1,000 on PyPI