Better proxy!
Project description
Better Proxy
Представление такой сущности, как proxy в виде класса.
- Метод
Proxy.from_str()
поддерживает большинство форматом прокси (с протоколом и без):host:port:login:password host:port@login:password host:port|login:password login:password@host:port login:password:host:port host:port
- Реализованы методы
__hash__
и__eq__
, что позволяет засовывть прокси в set() - Метод
Proxy.from_file()
возвращает список прокси из файла по указанному пути
pip install better-proxy
import aiohttp
from better_proxy import Proxy
from aiohttp_socks import ProxyConnector
async def fetch(url):
proxy = Proxy.from_str('socks5://user:password@127.0.0.1:1080')
connector = ProxyConnector.from_url(proxy.as_url)
async with aiohttp.ClientSession(connector=connector) as session:
async with session.get(url) as response:
return await response.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
better_proxy-0.2.0.tar.gz
(2.5 kB
view details)
Built Distribution
File details
Details for the file better_proxy-0.2.0.tar.gz
.
File metadata
- Download URL: better_proxy-0.2.0.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.0 CPython/3.11.2 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 362b5675e45e4de3719c6dc3ee4fe49a4287a9fc160413679141634f36b679ef |
|
MD5 | ffe208b1bf0dd0e8ea63ce8b7894e268 |
|
BLAKE2b-256 | 1b6e37801aea1979df373cf9cf9f682a3f33a3e7a0585f7c0f7614655234945e |
File details
Details for the file better_proxy-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: better_proxy-0.2.0-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.0 CPython/3.11.2 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3faeaee62a7357143584ef5ed435865accdf58e4e25dede6826500ce871b02e6 |
|
MD5 | f95cdd2c581d500919e269b07edec9ff |
|
BLAKE2b-256 | fff98a288e585797034690cc1ae2bc834316fa1d3d8fe493ee7ea6d87a9fcbe7 |