Skip to main content

Crate stygian_browser

Crate stygian_browser 

Source
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-detectionnavigator spoofing, 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.enable side-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 levelsNone / Basic / Advanced for 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

LevelnavigatorCanvasWebGLCDP protectHuman behavior
None
Basic
Advanced

§Module Overview

Re-exports§

pub use browser::BrowserInstance;
pub use config::BrowserConfig;
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::NavigatorProfile;
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 DevTools Protocol) 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