skillfed

httpx-socks

Proxy (HTTP, SOCKS) transports for httpx

httpx-socks v0.13.1 1.0M downloads/30d#4,507 on PyPI87
Permissive license Apache-2.0 Active released

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-socks

uv

uv add httpx-socks

poetry

poetry add httpx-socks

Installing 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

Development Status :: 5 - Production/StableFramework :: AsyncIOFramework :: TrioIntended Audience :: DevelopersOperating System :: MacOSOperating System :: MicrosoftOperating System :: POSIX :: LinuxProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: Internet :: WWW/HTTP

Tags

httpx proxy transportsocks5 proxy clienthttp proxy supportasync socks proxypython socks clientproxy tunnel httpx
proxy-transportsocks-clientasync-http

More WWW/HTTP packages