chaser_cf/lib.rs
1//! # chaser-cf
2//!
3//! High-performance Cloudflare bypass library with stealth browser automation.
4//!
5//! ## Features
6//!
7//! - **WAF Session**: Extract cookies and headers for authenticated requests
8//! - **Turnstile Solver**: Solve Cloudflare Turnstile captchas (min and max modes)
9//! - **Page Source**: Get HTML source from CF-protected pages
10//! - **Stealth Profiles**: Windows, Linux, macOS fingerprint profiles
11//!
12//! ## Usage (Rust)
13//!
14//! ```rust,no_run
15//! use chaser_cf::{ChaserCF, ChaserConfig, Profile};
16//!
17//! #[tokio::main]
18//! async fn main() -> anyhow::Result<()> {
19//! // Initialize with default config
20//! let chaser = ChaserCF::new(ChaserConfig::default()).await?;
21//!
22//! // Solve WAF session
23//! let session = chaser.solve_waf_session("https://example.com", None).await?;
24//! println!("Cookies: {:?}", session.cookies);
25//!
26//! // Get page source
27//! let source = chaser.get_source("https://example.com", None).await?;
28//! println!("HTML length: {}", source.len());
29//!
30//! // Solve Turnstile
31//! let token = chaser.solve_turnstile("https://example.com", None).await?;
32//! println!("Token: {}", token);
33//!
34//! // Explicit shutdown (or let it drop)
35//! chaser.shutdown().await;
36//!
37//! Ok(())
38//! }
39//! ```
40//!
41//! ## C FFI Usage
42//!
43//! ```c
44//! #include "chaser_cf.h"
45//!
46//! void on_result(const char* result, void* user_data) {
47//! printf("Result: %s\n", result);
48//! }
49//!
50//! int main() {
51//! chaser_init(NULL);
52//! chaser_solve_waf_async("https://example.com", NULL, NULL, on_result);
53//! // ... wait for callback
54//! chaser_shutdown();
55//! return 0;
56//! }
57//! ```
58
59pub mod core;
60pub mod error;
61pub mod models;
62
63#[cfg(feature = "ffi")]
64pub mod ffi;
65
66// Re-export main types at crate root
67pub use core::{ChaserCF, ChaserConfig};
68pub use error::ChaserError;
69pub use models::{Cookie, Profile, ProxyConfig, WafSession};