HTTPX with ProxyPanel
ProgrammingBy ProxyPanel Engineering Team
Updated Feb 25, 2026HTTPX with ProxyPanel
HTTPX is a modern HTTP client for Python with async support.
Installation
pip install httpx[socks]
Sync Usage
import httpx
proxy = "socks5://api-key:api-key@proxy-host:socks5-port"
with httpx.Client(proxy=proxy) as client:
response = client.get("https://httpbin.org/ip")
print(response.json())
Async Usage
import httpx
import asyncio
async def main():
proxy = "socks5://api-key:api-key@proxy-host:socks5-port"
async with httpx.AsyncClient(proxy=proxy) as client:
response = await client.get("https://httpbin.org/ip")
print(response.json())
asyncio.run(main())