Proxy (HTTP, SOCKS) transports for httpx
Project description
httpx-socks
Proxy transports for httpx library. SOCKS4(a), SOCKS5, HTTP (tunneling) proxy supported.
Requirements
- Python >= 3.6
- httpx >= 0.13.3
- async-timeout>=3.0.1
Installation
will be available soon, work is still in progress
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 (only asyncio backend 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.1.0.tar.gz
(14.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.1.0.tar.gz.
File metadata
- Download URL: httpx-socks-0.1.0.tar.gz
- Upload date:
- Size: 14.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 |
bc30c00f5e3b48746c9dd82abc6a7ead4c39bc7bf5c5b3e9353707b8d29d4759
|
|
| MD5 |
05f13053ce7deca552099343c192bf5b
|
|
| BLAKE2b-256 |
14eb504fc2d7fc0122cc1369da91c906227742cb0ace9c1dca3905fb77e9aec1
|
File details
Details for the file httpx_socks-0.1.0-py3-none-any.whl.
File metadata
- Download URL: httpx_socks-0.1.0-py3-none-any.whl
- Upload date:
- Size: 25.3 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 |
fbf426ff7ea139e0ac32482c0648d5e7d772f127181365e478d7c7552cd13868
|
|
| MD5 |
132417955d36f500f7d7a700c76fc9f6
|
|
| BLAKE2b-256 |
be7a5d26e308239c327f1420d6273aab4720cb4fe61045dc440c7ae730a3cdf5
|