| Crates.io | cloudscraper-rs |
| lib.rs | cloudscraper-rs |
| version | 0.2.0 |
| created_at | 2025-11-09 12:18:37.916723+00 |
| updated_at | 2026-01-02 22:58:54.294457+00 |
| description | Early-stage Cloudflare challenge solver bringing Python's Cloudscraper ideas to Rust |
| homepage | https://github.com/Ryujin-K/cloudscraper-rs |
| repository | https://github.com/Ryujin-K/cloudscraper-rs |
| max_upload_size | |
| id | 1924065 |
| size | 1,616,779 |
A Cloudflare challenge solver that reimagines the Python cloudscraper ethos in Rust.
Status: This crate is still early-stage. Expect sharp edges, missing features, and ecosystem gaps while the Rust tooling for advanced bypass work catches up. Contributions and bug reports are welcome.
use cloudscraper_rs::CloudScraper;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let scraper = CloudScraper::new()?;
let response = scraper.get("https://example.com").await?;
let html = response.text().await?;
println!("Success! Got {} bytes", html.len());
Ok(())
}
[dependencies]
cloudscraper-rs = "0.1"
tokio = { version = "1.0", features = ["full"] }
use cloudscraper_rs::UserAgentOptions;
let ua_opts = UserAgentOptions {
desktop: false,
mobile: true,
..Default::default()
};
let scraper = CloudScraper::builder()
.with_max_challenge_attempts(5) // Retry budget for the pipeline
.with_user_agent_options(ua_opts) // Customise UA/platform selection
.with_proxies(["http://127.0.0.1:8888"]) // Optional proxy pool
.disable_adaptive_timing() // Toggle subsystems as needed
.disable_ml_optimization()
.build()?;
See cloudscraper.rs for additional builder toggles (custom captcha provider, TLS config, spoofing consistency, etc.).
CloudScraper
├─ Reqwest client pool (shared cookie jar, proxy aware)
├─ Challenge pipeline
│ ├─ detectors → pattern scoring / adaptive learning
│ ├─ solvers → javascript_v1/v2, managed_v3, turnstile, rate_limit, access_denied, bot_management
│ └─ mitigation planner → retries, proxy hints, wait suggestions
├─ Adaptive modules
│ ├─ anti_detection (header randomisation & cooldowns)
│ ├─ adaptive_timing (behavioural delays)
│ ├─ spoofing (consistent fingerprints & UAs)
│ ├─ tls (JA3 / cipher rotation)
│ ├─ metrics/events (telemetry + logging hooks)
│ └─ ml optimisation (feature scoring)
└─ State manager (per-domain history, error tracking)
Flow: request() → prepare headers/timing → fetch → detector identifies challenge → solver produces submission or mitigation → retry with solved tokens.
Ship optional headless fallback integration
Expand captcha provider catalogue
Persist state/metrics for long-running bots
Add first-class CLI / interactive probe tool
Harden JavaScript VM sandboxing further
This project is licensed under the MIT License - see the LICENSE file for details.
This library is for educational purposes only. Please respect website terms of service and robots.txt files. The authors are not responsible for misuse of this software.