httpx-socks
The httpx-socks package provides proxy transports for httpx client.
SOCKS4(a), SOCKS5(h), HTTP CONNECT proxy supported.
It uses python-socks for core proxy functionality.
Requirements
- Python >= 3.9
- httpx>=0.28.0,<0.29.0
- python-socks>=2.4.3,<3.0.0
- trio>=0.30 (optional)
- anyio>=4.12,<5.0.0 (optional)
Installation
only sync proxy support:
pip install httpx-socks
to include optional asyncio support (it requires async-timeout):
pip install httpx-socks[asyncio]
to include optional trio support:
pip install httpx-socks[trio]
Usage
sync transport
import httpx
from httpx_socks import SyncProxyTransport
def fetch(url):
transport = SyncProxyTransport.from_url('socks5://user:password@127.0.0.1:1080')
with httpx.Client(transport=transport) as client:
res = client.get(url)
return res.text
async transport (asyncio, trio)
import httpx
from httpx_socks import AsyncProxyTransport
async def fetch(url):
transport = AsyncProxyTransport.from_url('socks5://user:password@127.0.0.1:1080')
async with httpx.AsyncClient(transport=transport) as client:
res = await client.get(url)
return res.text
secure proxy connections (experimental feature, both sync and async support)
import ssl
import httpx
from httpx_socks import AsyncProxyTransport
async def fetch(url):
proxy_ssl = ssl.create_default_context()
proxy_ssl.load_verify_locations(...)
transport = AsyncProxyTransport.from_url('http://user:password@127.0.0.1:8080', proxy_ssl=proxy_ssl)
async with httpx.AsyncClient(transport=transport) as client:
res = await client.get(url)
return res.text
Metadata
Release files for httpx-socks 0.13.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| httpx_socks-0.13.1.tar.gz | 120.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| httpx_socks-0.13.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 134.7 kB
Release files / httpx_socks-0.13.1.tar.gz
| Download URL | httpx_socks-0.13.1.tar.gz |
|---|---|
| Size | 120.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9114898471eb0b2c1f67749f1d2b1c9d35c9f6c450d2f5c338033fc2d0af2d20
|
|
BLAKE2b-256 checksum How to use checksums |
2a8a1a36f6c3324d19c33e2b8a72222c609a950d271560a8198283c92dd808d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / httpx_socks-0.13.1-py3-none-any.whl
| Download URL | httpx_socks-0.13.1-py3-none-any.whl |
|---|---|
| Size | 13.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
771b4f3dbc8f62515a6f8a64f3e1dea9a7826a2521032351d3bd5cc008486bb6
|
|
BLAKE2b-256 checksum How to use checksums |
19642f64faa059e5f413de846aefd4e7c1db3273fb49a62e1e1767280f2d1d88
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for httpx-socks 0.13.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.