Skip to main content

stygian_proxy/
lib.rs

1//! # stygian-proxy
2//!
3//! High-performance, resilient proxy rotation for the Stygian scraping ecosystem.
4//!
5//! ## Features
6//!
7//! - Pluggable rotation strategies: round-robin, random, weighted, least-used
8//! - Per-proxy latency and success-rate tracking via atomics
9//! - Async health checker with configurable intervals
10//! - Per-proxy circuit breaker (Closed → Open → HalfOpen)
11//! - In-memory proxy pool (no external DB required)
12//! - `graph` feature: [`ProxyManagerPort`] trait for stygian-graph HTTP adapters
13//! - `browser` feature: per-context proxy binding for stygian-browser
14//!
15//! ## Quick start
16//!
17//! ```rust,no_run
18//! use stygian_proxy::error::ProxyResult;
19//!
20//! fn main() -> ProxyResult<()> {
21//!     // ProxyManager construction added in T12 (proxy-manager task)
22//!     Ok(())
23//! }
24//! ```
25
26pub mod circuit_breaker;
27pub mod error;
28pub mod health;
29pub mod manager;
30pub mod storage;
31pub mod strategy;
32pub mod types;
33
34#[cfg(feature = "graph")]
35pub mod graph;
36
37#[cfg(feature = "browser")]
38pub mod browser;
39
40// Top-level re-exports
41pub use circuit_breaker::{CircuitBreaker, STATE_CLOSED, STATE_HALF_OPEN, STATE_OPEN};
42pub use error::{ProxyError, ProxyResult};
43pub use health::{HealthChecker, HealthMap};
44pub use manager::{PoolStats, ProxyHandle, ProxyManager, ProxyManagerBuilder};
45pub use storage::MemoryProxyStore;
46pub use strategy::{
47    BoxedRotationStrategy, LeastUsedStrategy, ProxyCandidate, RandomStrategy, RotationStrategy,
48    RoundRobinStrategy, WeightedStrategy,
49};
50pub use types::{Proxy, ProxyConfig, ProxyMetrics, ProxyRecord, ProxyType};
51
52#[cfg(feature = "graph")]
53pub use graph::{BoxedProxyManager, NoopProxyManager, ProxyManagerPort};
54
55#[cfg(feature = "browser")]
56pub use browser::{BrowserProxySource, ProxyManagerBridge};