Proxy (HTTP, SOCKS) transports for httpx
Project description
httpx-socks
Proxy transports for httpx client. SOCKS4(a), SOCKS5, HTTP (tunneling) proxy supported.
Requirements
- Python >= 3.6
- httpx >= 0.13.3
- python-socks[asyncio,trio] >= 1.0.1
Installation
pip install httpx-socks
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 (both asyncio and trio supported)
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
httpx-socks-0.2.7.tar.gz
(7.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file httpx-socks-0.2.7.tar.gz.
File metadata
- Download URL: httpx-socks-0.2.7.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.0.0.post20200106 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
539d2e9925bfe87377447b407c0ddfd47bdeb0bd580e575bb7596f1b64def442
|
|
| MD5 |
978727aad377ced7b7ae58233c6808d4
|
|
| BLAKE2b-256 |
658ae06eb09c077e74586d6dc9b783b0d236bac1f2f9bc74f4497619ece24237
|
File details
Details for the file httpx_socks-0.2.7-py3-none-any.whl.
File metadata
- Download URL: httpx_socks-0.2.7-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.0.0.post20200106 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
224aca66fa9ffa55f343b76fe27499817b9373f5c34f0e78a2a6b63f673852c5
|
|
| MD5 |
5c91719775f45b4fd701378281959e7e
|
|
| BLAKE2b-256 |
cd4cc4947474c6807c7481b0b2a94a57a0f8c4f5619529b8a07dc785bb64057b
|