pub struct ChaserCF { /* private fields */ }Expand description
chaser-cf - High-level API for Cloudflare bypass operations
§Example
use chaser_cf::{ChaserCF, ChaserConfig};
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let chaser = ChaserCF::new(ChaserConfig::default()).await?;
let session = chaser.solve_waf_session("https://example.com", None).await?;
println!("Got {} cookies", session.cookies.len());
chaser.shutdown().await;
Ok(())
}Implementations§
Source§impl ChaserCF
impl ChaserCF
Sourcepub async fn new(config: ChaserConfig) -> ChaserResult<Self>
pub async fn new(config: ChaserConfig) -> ChaserResult<Self>
Create a new ChaserCF instance with the given configuration.
This will initialize the browser immediately unless lazy_init is enabled
in the configuration.
Sourcepub async fn init(&self) -> ChaserResult<()>
pub async fn init(&self) -> ChaserResult<()>
Initialize the browser explicitly.
This is called automatically on first use if lazy_init is enabled,
or during construction if lazy_init is disabled.
Sourcepub async fn get_source(
&self,
url: &str,
proxy: Option<ProxyConfig>,
) -> ChaserResult<String>
pub async fn get_source( &self, url: &str, proxy: Option<ProxyConfig>, ) -> ChaserResult<String>
Sourcepub async fn solve_waf_session(
&self,
url: &str,
proxy: Option<ProxyConfig>,
) -> ChaserResult<WafSession>
pub async fn solve_waf_session( &self, url: &str, proxy: Option<ProxyConfig>, ) -> ChaserResult<WafSession>
Sourcepub async fn solve_turnstile(
&self,
url: &str,
proxy: Option<ProxyConfig>,
) -> ChaserResult<String>
pub async fn solve_turnstile( &self, url: &str, proxy: Option<ProxyConfig>, ) -> ChaserResult<String>
Sourcepub async fn solve_turnstile_min(
&self,
url: &str,
site_key: &str,
proxy: Option<ProxyConfig>,
) -> ChaserResult<String>
pub async fn solve_turnstile_min( &self, url: &str, site_key: &str, proxy: Option<ProxyConfig>, ) -> ChaserResult<String>
Solve a Turnstile captcha with minimal resource usage
This mode intercepts the page request and serves a minimal HTML page that only loads the Turnstile widget. Requires the site key.
§Arguments
url- URL to use as the Turnstile originsite_key- The Turnstile site keyproxy- Optional proxy configuration
§Returns
The Turnstile token string.
Sourcepub fn config(&self) -> &ChaserConfig
pub fn config(&self) -> &ChaserConfig
Get configuration
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ChaserCF
impl !RefUnwindSafe for ChaserCF
impl Send for ChaserCF
impl Sync for ChaserCF
impl Unpin for ChaserCF
impl UnsafeUnpin for ChaserCF
impl !UnwindSafe for ChaserCF
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more