ProxyProvider Shared Interface
- class proxyproviders.proxy_provider.ProxyConfig(refresh_interval: float = 600)[source]
Bases:
object
Provides standard shared configuration options for all proxy providers.
Example:
from proxyproviders import Webshare, ProxyConfig config = ProxyConfig(refresh_interval=5) proxy_provider = Webshare(api_key="your-api-key", config=config)
- refresh_interval: float = 600
Duration in seconds after which the proxy list is refreshed to fetch new proxies. Set to 0 to disable automatic refreshing after the initial fetch.
- class proxyproviders.proxy_provider.ProxyProvider(config: ProxyConfig | None = None)[source]
Bases:
ABC
Base class for all proxy providers that provides shared functionality across all providers.
You’ll need to use a specific provider to fetch proxies and this shouldn’t directly be initialized. However, this class is useful for type hinting and for creating custom providers that are not included in the library, although consider contributing them to the library if you are making them.
- Parameters:
config – Configuration for the proxy provider. View the ProxyConfig class docs for more information.