Expand description
§stygian-browser
High-performance, anti-detection browser automation library for Rust.
Built on Chrome DevTools Protocol (CDP) via chromiumoxide
with comprehensive stealth features to bypass modern anti-bot systems:
Cloudflare, DataDome, PerimeterX, and Akamai Bot Manager.
§Features
- Browser pooling — warm pool with min/max sizing, LRU eviction, and backpressure; sub-100 ms acquire from the warm queue
- Anti-detection —
navigatorspoofing, canvas noise, WebGL randomisation, User-Agent patching, and plugin population - Human behaviour — Bézier-curve mouse paths, human-paced typing with typos, random scroll and micro-interactions
- CDP leak protection — hides
Runtime.enableside-effects that expose automation - WebRTC control — block, proxy-route, or allow WebRTC to prevent IP leaks
- Fingerprint generation — statistically-weighted device profiles matching real-world browser market share distributions
- Stealth levels —
None/Basic/Advancedfor tuning evasion vs performance
§Quick Start
use stygian_browser::{BrowserPool, BrowserConfig, WaitUntil};
use std::time::Duration;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Default config: headless, Advanced stealth, pool of 2–10 browsers
let config = BrowserConfig::default();
let pool = BrowserPool::new(config).await?;
// Acquire a browser from the warm pool (< 100 ms)
let handle = pool.acquire().await?;
// Open a tab and navigate
let mut page = handle.browser().expect("valid browser").new_page().await?;
page.navigate(
"https://example.com",
WaitUntil::Selector("body".to_string()),
Duration::from_secs(30),
).await?;
println!("Title: {}", page.title().await?);
// Return the browser to the pool
handle.release().await;
Ok(())
}§Stealth Levels
| Level | navigator | Canvas | WebGL | CDP protect | Human behavior |
|---|---|---|---|---|---|
None | — | — | — | — | — |
Basic | ✓ | — | — | ✓ | — |
Advanced | ✓ | ✓ | ✓ | ✓ | ✓ |
§Module Overview
| Module | Description |
|---|---|
browser | BrowserInstance — launch, health-check, shutdown |
pool | BrowserPool + BrowserHandle — warm pool management |
page | PageHandle — navigate, eval, content, cookies |
config | BrowserConfig + builder pattern |
error | BrowserError and Result alias |
stealth | StealthProfile, NavigatorProfile |
fingerprint | DeviceProfile, BrowserKind |
behavior | behavior::MouseSimulator, behavior::TypingSimulator |
webrtc | WebRtcConfig, WebRtcPolicy, ProxyLocation |
cdp_protection | CDP leak protection modes |
Re-exports§
pub use browser::BrowserInstance;pub use config::BrowserConfig;pub use config::HeadlessMode;pub use error::BrowserError;pub use error::Result;pub use page::PageHandle;pub use page::ResourceFilter;pub use page::WaitUntil;pub use pool::BrowserHandle;pub use pool::BrowserPool;pub use pool::PoolStats;pub use stealth::StealthConfig;pub use stealth::StealthProfile;pub use behavior::InteractionLevel;pub use fingerprint::BrowserKind;pub use fingerprint::DeviceProfile;pub use webrtc::ProxyLocation;pub use webrtc::WebRtcConfig;pub use webrtc::WebRtcPolicy;
Modules§
- behavior
- Human behavior simulation for anti-detection
- browser
- Browser instance lifecycle management
- cdp_
protection - CDP (Chrome
DevToolsProtocol) leak protection - config
- Browser configuration and options
- error
- Error types for browser automation operations
- fingerprint
- Browser fingerprint generation and JavaScript injection.
- page
- Page and browsing context management for isolated, parallel scraping
- pool
- Browser instance pool with warmup, health checks, and idle eviction
- prelude
- Prelude module for convenient imports
- recorder
- Browser session recording and debugging tools.
- session
- Session persistence for long-running scraping campaigns.
- stealth
- Stealth configuration and anti-detection features
- webrtc
- WebRTC IP leak prevention and geolocation consistency