Skip to main content

Manages proxies for http or selenium and some common uses cases like random,cycle, or set env/sys proxy.

Project description

cd_proxy_manager

cd_proxy_manager is a Python package designed to handle proxy configurations and management for various purposes such as setting environment proxies, formatting proxies, and dealing with proxies in HTTP requests and browsers.

Installation

To install cd_proxy_manager, clone the repository and install the required dependencies:

git clone <repository-url>
cd cd_proxy_manager
pip install -r requirements.txt

or

pip install cd-proxy-manager

Modules

__init__.py

This file initializes the package.

browser_judges.py

This module includes various browser judge urls.

format_proxy.py

This module provides functionality for formatting proxies in various formats, making them suitable for use with different libraries and tools.

http_judges.py

This module includes various HTTP judge urls.

proxy_dealer.py

This module is designed to manage and deal with multiple proxies, possibly including rotation and validation.

set_env_proxy.py

This module provides a function to set an environment variable for a proxy, supporting both simple and authenticated proxies.

set_global_proxy.py

This module includes functionality to set a global proxy configuration for the system.

version.py

This module defines the version of the cd_proxy_manager package.

examples/

This directory contains example scripts demonstrating how to use the various functionalities provided by the package.

Usage

Formatting Proxies

To format a proxy, see example in the examples folder.

Setting Environment Proxy

To set an environment proxy, use the set_env_proxy.py module:

from cd_proxy_manager import SysProxy

# Example: setting a proxy environment variable
proxy = "proxy:port"
SysProxy().set_proxy(proxy)

Proxy Management

To manage multiple proxies, use the proxy_dealer.py module:

from cd_proxy_manager import ProxyDealer

# Example: rotating proxies
dealer = ProxyDealer(["proxy1:port", "proxy2:port"])
proxy = dealer.get_next_proxy_no_shuffle()
print(proxy)

See all Examples

Refer to the examples/ directory for more detailed usage examples.

Contributing

Contributions are welcome! Please submit a pull request or open an issue to discuss any changes.

License

This project is licensed under the MIT License.

For more information, visit codedocta.com.

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

cd_proxy_manager-0.2.6.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

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

cd_proxy_manager-0.2.6-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file cd_proxy_manager-0.2.6.tar.gz.

File metadata

  • Download URL: cd_proxy_manager-0.2.6.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.7 Windows/10

File hashes

Hashes for cd_proxy_manager-0.2.6.tar.gz
Algorithm Hash digest
SHA256 fee37961ae83bd78330d6859d61415f8763a8e5239d1fc0b72172e2bc13fd657
MD5 9ca7c49b067e41362d0520b5609a605a
BLAKE2b-256 e56758f3acf7672483d1f05b55f1bd32f1a9de46fd0025f58f63710357263566

See more details on using hashes here.

File details

Details for the file cd_proxy_manager-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: cd_proxy_manager-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.7 Windows/10

File hashes

Hashes for cd_proxy_manager-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 caa056c023e406d8c82f94417f320e09cef451dce41cb77bae6ef1b819cd0cb5
MD5 5045e3549226a86c7c653a4de36f2af7
BLAKE2b-256 1686a9558f51c2316575862a869e01496ea8e9313090cb2a892b2b28118f2030

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