pub struct ProxyConfig {
pub health_check_url: String,
pub health_check_interval: Duration,
pub health_check_timeout: Duration,
pub health_check_jitter_pct: f32,
pub circuit_open_threshold: u32,
pub circuit_half_open_after: Duration,
pub sticky_policy: StickyPolicy,
pub profiled_request_mode: Option<ProfiledRequestMode>,
pub max_requests_per_connection: Option<u32>,
pub connection_max_age_secs: Option<u64>,
}Expand description
Configuration governing health checking and circuit-breaker behaviour.
Duration fields serialize as integer seconds for TOML/JSON compatibility.
§Example
use stygian_proxy::types::ProxyConfig;
use std::time::Duration;
let cfg = ProxyConfig::default();
assert_eq!(cfg.health_check_url, "https://httpbin.org/ip");
assert_eq!(cfg.health_check_interval, Duration::from_secs(60));
assert_eq!(cfg.health_check_timeout, Duration::from_secs(5));
assert_eq!(cfg.circuit_open_threshold, 5);
assert_eq!(cfg.circuit_half_open_after, Duration::from_secs(30));
assert!(cfg.profiled_request_mode.is_none());
assert_eq!(cfg.health_check_jitter_pct, 0.20_f32);
assert!(cfg.max_requests_per_connection.is_none());
assert!(cfg.connection_max_age_secs.is_none());Fields§
§health_check_url: StringURL called during health checks to verify proxy liveness.
health_check_interval: DurationHow often to run health checks (seconds).
health_check_timeout: DurationPer-probe HTTP timeout (seconds).
health_check_jitter_pct: f32Jitter factor applied to the health-check sleep window.
0.20 distributes each check window uniformly over
interval × [0.80, 1.20), preventing synchronised fleet-wide check
storms. Set to 0.0 to disable jitter. Clamped to [0.0, 0.99]
at runtime.
Default: 0.20 (±20 %).
circuit_open_threshold: u32Consecutive failures before the circuit trips to OPEN.
circuit_half_open_after: DurationHow long to wait in OPEN before transitioning to HALF-OPEN (seconds).
sticky_policy: StickyPolicySticky-session policy for domain→proxy binding.
profiled_request_mode: Option<ProfiledRequestMode>Optional default mode for TLS-profiled helper clients.
When set and tls-profiled is enabled, ProxyManager initializes its
HealthChecker with a Chrome-profiled requester using this mode.
Ignored when tls-profiled is disabled.
max_requests_per_connection: Option<u32>Maximum requests routed through one persistent TCP connection before it
is recycled. None means no limit. Only consulted when
crate::routing::TransportPreference::PersistentTcp is active.
connection_max_age_secs: Option<u64>Maximum age of a persistent TCP connection in seconds before it is
replaced. None means no age limit.
Trait Implementations§
Source§impl Clone for ProxyConfig
impl Clone for ProxyConfig
Source§fn clone(&self) -> ProxyConfig
fn clone(&self) -> ProxyConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more