Skip to main content

Async Python proxy manager with latency testing

Project description

aioprox

Python Version License

aioprox – Asynchronous proxy manager for Python. Fetch, test, and filter HTTP/SOCKS proxies with optional latency measurement and support for custom sources.


Project Overview

aioprox is designed for developers who need a reliable, asynchronous proxy management tool in Python. It allows you to quickly fetch proxies from multiple sources, test them concurrently, and optionally measure latency to select the fastest proxies. Whether you want a single random live proxy or a fully sorted list of working proxies, aioprox makes it easy. You can also supply your own proxy lists via a file, URL, or Python list.


Features

  • Fetch proxies from multiple built-in sources or user-supplied sources (URL, file, or list).
  • Test proxies asynchronously for availability.
  • Optional latency measurement to find the fastest proxies.
  • Retrieve a single random live proxy or a full list of working proxies.
  • Supports HTTP, SOCKS4, and SOCKS5 proxies.
  • Concurrency control for fast testing of large proxy lists.
  • Easy to integrate in both scripts and larger Python projects.

Installation

pip install aiohttp aiohttp_socks

Then clone or download aioprox.py into your project.


Usage

1. Using a Built-in Source

from aioprox import Proxy

# Initialize with built-in source
p = Proxy(proxy_type="http", source="monosans")

# Get all live proxies
proxies = p.get_good_proxies()
print(proxies)

# Get a single random live proxy
random_proxy = p.get_random_proxy()
print(f"Random proxy: {random_proxy}")

2. Measuring Latency

# Enable latency measurement
p = Proxy(proxy_type="http", source="monosans", latency=True)

# Get proxies sorted by latency
proxies = p.get_good_proxies()

# Get the fastest proxy
fastest_proxy = p.get_random_proxy()
print(proxies)
print(f"Fastest proxy: {fastest_proxy}")

3. Using a Custom List of Proxies

custom_list = [
    "123.45.67.89:8080",
    "98.76.54.32:1080",
]

p = Proxy(proxy_type="http", custom_source=custom_list, latency=True)
proxies = p.get_good_proxies()
print(proxies)

4. Using a Custom URL or File

# From a URL
p = Proxy(proxy_type="socks5", custom_source="https://example.com/proxylist.txt")
proxies = p.get_good_proxies()
print(proxies)

# From a local file
p = Proxy(proxy_type="http", custom_source="proxies.txt")
proxies = p.get_good_proxies()
print(proxies)

Supported Proxy Types

  • HTTP
  • SOCKS4
  • SOCKS5

Concurrency

By default, proxy testing uses a concurrency of 50. You can adjust it when creating the Proxy object:

p = Proxy(proxy_type="http", source="monosans", concurrency=100)

Error Handling

  • Failed proxy sources print informative messages.
  • Dead proxies are automatically filtered out.
  • Latency measurement is optional; if not enabled, only live/dead status is returned.

Example Output

[{'proxy': '123.45.67.89:8080', 'latency': 0.234},
 {'proxy': '98.76.54.32:1080', 'latency': 0.421}]
Fastest proxy: 123.45.67.89:8080

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aioprox-0.1.4.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aioprox-0.1.4-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file aioprox-0.1.4.tar.gz.

File metadata

  • Download URL: aioprox-0.1.4.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for aioprox-0.1.4.tar.gz
Algorithm Hash digest
SHA256 ff440398ff20219f3f6639277c08ef96fdc7d82bafe6a7f7b1fd7802f481a6a2
MD5 0231ab90e7e40f429ce490ec2c54c484
BLAKE2b-256 3e698fb75b10df5775d410d67bf8523b3d88555a806368449ad9986e2fb10456

See more details on using hashes here.

File details

Details for the file aioprox-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: aioprox-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for aioprox-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 fd7f36a45dd2759c1fc96c12d8dccc4beb63d799667c50dd0a33449b78211c3f
MD5 d13f75a58511799e7f3bcef796f60ea7
BLAKE2b-256 b823d01d1d5b38324d47f50c6c707dc8a747313d159a053003cc1d9f205cbb01

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page