Provides proxy transports (HTTP, SOCKS4, SOCKS5) for httpx, enabling proxy support for both sync and async httpx clients. Currently at version 0.11.0, released with support for Python >=3.8. The library wraps httpx transports using PySocks and optionally trio for async. Releases are infrequent, with the last update in 2024.
pip install httpx-socksVerified import paths — ran on the pinned version, not inferred.
Create a sync httpx client with SOCKS5 proxy authentication.
Always use `SyncProxyTransport` for sync clients and `AsyncProxyTransport` for async clients.
Use `SyncProxyTransport.from_url(url)` or `AsyncProxyTransport.from_url(url)`.
Upgrade both to latest: `pip install -U httpx httpx-socks`
Include credentials in the URL: `socks5://username:password@host:port`
Run `pip install httpx-socks` in the correct Python environment.
Use `from httpx_socks import SyncProxyTransport` or `AsyncProxyTransport`.
Pass the proxy URL as the first positional argument: `...from_url('socks5://...')`Verify the proxy hostname and check network connectivity.