pub struct ProxyPoolConfigBuilder { /* private fields */ }Expand description
Builder for ProxyPoolConfig.
Implementations§
Source§impl ProxyPoolConfigBuilder
impl ProxyPoolConfigBuilder
Sourcepub fn sources(self, sources: Vec<impl Into<String>>) -> Self
pub fn sources(self, sources: Vec<impl Into<String>>) -> Self
Set the source URLs to fetch proxy lists from.
Sourcepub fn health_check_interval(self, interval: Duration) -> Self
pub fn health_check_interval(self, interval: Duration) -> Self
Set the interval between health checks.
Sourcepub fn health_check_timeout(self, timeout: Duration) -> Self
pub fn health_check_timeout(self, timeout: Duration) -> Self
Set the timeout for health checks.
Sourcepub fn min_available_proxies(self, count: usize) -> Self
pub fn min_available_proxies(self, count: usize) -> Self
Set the minimum number of available proxies.
Sourcepub fn health_check_url(self, url: impl Into<String>) -> Self
pub fn health_check_url(self, url: impl Into<String>) -> Self
Set the URL used for health checks.
Sourcepub fn retry_count(self, count: usize) -> Self
pub fn retry_count(self, count: usize) -> Self
Set the number of times to retry a request with different proxies.
Sourcepub fn selection_strategy(self, strategy: ProxySelectionStrategy) -> Self
pub fn selection_strategy(self, strategy: ProxySelectionStrategy) -> Self
Set the strategy for selecting proxies.
Sourcepub fn max_requests_per_second(self, rps: f64) -> Self
pub fn max_requests_per_second(self, rps: f64) -> Self
Set the maximum requests per second per proxy.
Sourcepub fn response_classifier(self, classifier: impl ResponseClassifier) -> Self
pub fn response_classifier(self, classifier: impl ResponseClassifier) -> Self
Set a custom response classifier for business-level proxy health feedback.
Use this to detect captchas, anti-bot pages, or other blocking responses that pass HTTP-level checks but indicate the proxy is unusable.
Sourcepub fn danger_accept_invalid_certs(self, accept: bool) -> Self
pub fn danger_accept_invalid_certs(self, accept: bool) -> Self
Accept invalid TLS certificates when connecting through proxies.
Required for most free SOCKS5 proxies that perform TLS interception.
Default: false.
Sourcepub fn build(self) -> ProxyPoolConfig
pub fn build(self) -> ProxyPoolConfig
Build the configuration.