ProxyManager class

Manager for proxy operations

Implementers

Constructors

ProxyManager({required GetProxies getProxies, required ValidateProxy validateProxy, required GetValidatedProxies getValidatedProxies, ProxyAnalyticsService? analyticsService, ProxyPreloaderService? preloaderService, ProxyCacheManager? cacheManager, RotationStrategyType strategyType = RotationStrategyType.roundRobin})
Creates a new ProxyManager with the given use cases

Properties

analyticsService → ProxyAnalyticsService?
Analytics service for tracking proxy usage
final
getProxies → GetProxies
Use case for getting proxies
final
getValidatedProxies → GetValidatedProxies
Use case for getting validated proxies
final
hashCode → int
The hash code for this object.
no setterinherited
proxies → List<Proxy>
Gets the current list of proxies
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
validatedProxies → List<Proxy>
Gets the current list of validated proxies
no setter
validateProxy → ValidateProxy
Use case for validating proxies
final

Methods

fetchProxies({ProxyFilterOptions options = const ProxyFilterOptions()}) → Future<List<Proxy>>
Fetches proxies from various sources with advanced filtering options
fetchProxiesLegacy({int count = 20, bool onlyHttps = false, List<String>? countries}) → Future<List<Proxy>>
Fetches proxies from various sources with legacy parameters
fetchValidatedProxies({ProxyFilterOptions options = const ProxyFilterOptions(count: 10), void onProgress(int completed, int total)?}) → Future<List<Proxy>>
Gets a list of validated proxies with advanced filtering options
fetchValidatedProxiesLegacy({int count = 10, bool onlyHttps = false, List<String>? countries, void onProgress(int completed, int total)?}) → Future<List<Proxy>>
Gets a list of validated proxies with legacy parameters
getAnalytics() → Future<ProxyAnalytics?>
Gets the current analytics data
getLeastRecentlyUsedProxy({bool validated = true}) → Proxy
Gets the least recently used proxy
getNextProxy({bool validated = true, bool useScoring = false, RotationStrategyType strategyType = RotationStrategyType.roundRobin}) → Proxy
Gets the next proxy in the rotation
getRandomProxy({bool validated = true, bool useScoring = false}) → Proxy
Gets a random proxy
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
recordFailure(Proxy proxy) → Future<void>
Records a failed request with a proxy
recordSuccess(Proxy proxy, [int? responseTimeMs]) → Future<void>
Records a successful request with a proxy
resetAnalytics() → Future<void>
Resets the analytics data
setRotationStrategy(RotationStrategyType strategyType) → void
Sets the proxy rotation strategy
toString() → String
A string representation of this object.
inherited
validateSpecificProxy(Proxy proxy, {String? testUrl, int timeout = 10000, bool updateScore = true}) → Future<bool>
Validates a specific proxy

Operators

operator ==(Object other) → bool
The equality operator.
inherited