use chaser_cf::{ChaserCF, ChaserConfig};
#[tokio::main]
async fn main() -> anyhow::Result<()> {
tracing_subscriber::fmt()
.with_env_filter("chaser_cf=info")
.init();
println!("chaser-cf - Cloudflare Bypass Library");
println!("========================================\n");
let config = ChaserConfig::default()
.with_lazy_init(false)
.with_timeout_ms(60000);
println!("Initializing chaser-cf...");
let chaser = ChaserCF::new(config).await?;
println!("chaser-cf initialized!\n");
let url = std::env::args()
.nth(1)
.unwrap_or_else(|| "https://example.com".to_string());
println!("Fetching source from: {}", url);
match chaser.get_source(&url, None).await {
Ok(source) => {
println!("Got {} bytes of HTML", source.len());
println!("First 500 chars:\n{}", &source[..source.len().min(500)]);
}
Err(e) => {
println!("Error: {}", e);
}
}
chaser.shutdown().await;
println!("\nchaser-cf shutdown complete");
Ok(())
}