Skip to main content

Crate ghostwire

Crate ghostwire 

Source
Expand description

§ghostwire

A Rust library to bypass Cloudflare’s anti-bot protections.

§Quick start

use ghostwire::Ghostwire;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let mut scraper = Ghostwire::new()?;
    let resp = scraper.get("https://example.com").await?;
    println!("Status: {}", resp.status());
    Ok(())
}

§With captcha solver

use ghostwire::{Ghostwire, captcha::CaptchaConfig};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let captcha = CaptchaConfig {
        provider: "2captcha".into(),
        api_key: Some("your_api_key".into()),
        ..Default::default()
    };

    let mut scraper = Ghostwire::builder()
        .captcha(captcha)
        .debug(true)
        .build()?;

    let resp = scraper.get("https://protected.example.com").await?;
    println!("{}", resp.text().await?);
    Ok(())
}

Re-exports§

pub use captcha::CaptchaConfig;
pub use captcha::CaptchaKind;
pub use challenge::JsInterpreter;
pub use client::Ghostwire;
pub use client::GhostwireBuilder;
pub use client::RequestOptions;
pub use error::GhostwireError;
pub use error::Result;
pub use proxy_manager::ProxyManager;
pub use proxy_manager::RotationStrategy;
pub use stealth::StealthConfig;
pub use user_agent::Browser;
pub use user_agent::UserAgent;
pub use user_agent::UserAgentOptions;

Modules§

captcha
Captcha solver trait and built-in provider implementations.
challenge
Cloudflare challenge detection and solving modules.
client
Core Ghostwire client – wraps reqwest with Cloudflare bypass logic.
error
Error types for ghostwire.
proxy_manager
Proxy pool management with sequential, random and “smart” rotation strategies.
stealth
Stealth techniques: human-like delays, header randomisation, browser quirks.
user_agent
User-agent & browser header management.

Constants§

VERSION