Expand description
Auto-managed Byparr/FlareSolverr client for bypassing bot detection.
Provides a unified client for the FlareSolverr-compatible API used by both Byparr and FlareSolverr.
§Features
- Automatic Docker container lifecycle (pull, start, health-wait, restart, drop)
- Provider-agnostic: Byparr, FlareSolverr, or any compatible image
- Builder-style
SolveRequestwith GET/POST, headers, cookies, proxy, sessions, fingerprint - Per-domain session/cookie cache so repeat solves are free
- Concurrent-solve coalescer that dedupes parallel solves
- Retry policy with exponential backoff
- Lock-free
MetricsSnapshotfor observability - Optional disk-replay sink for debugging
- Round-robin across multiple instances
solve_streamfor batch use with bounded concurrency- Standalone
detecthelpers for cheap challenge fingerprinting
§Quick start
use antibot_rs::{Antibot, Provider};
let client = Antibot::builder()
.provider(Provider::Byparr)
.auto_start(true)
.enable_session_cache()
.build()
.await?;
let solution = client.solve("https://example.com").await?;
println!("Got {} bytes of HTML", solution.html().len());§Full-featured example
use antibot_rs::{
Antibot, CoalesceKey, Cookie, DebugConfig, DockerLimits, ProxyConfig,
Provider, RetryPolicy, SolveRequest,
};
use std::time::Duration;
let client = Antibot::builder()
.provider(Provider::Byparr)
.auto_start(true)
.docker_limits(DockerLimits::default().memory("2g").cpus("1.5").shm_size("1g"))
.enable_session_cache()
.coalesce_solves(CoalesceKey::Domain)
.retry(RetryPolicy::default())
.default_proxy(ProxyConfig::http("http://proxy.example:8080"))
.debug(DebugConfig::new("./antibot-replay"))
.health_watch(Duration::from_secs(30))
.manage_lifecycle(true)
.build()
.await?;
let solution = client.execute(
SolveRequest::post("https://site.com/api/login")
.json(serde_json::json!({"user": "alice"}))
.with_header("X-Custom", "value")
.with_cookie(Cookie::new("session", "abc123"))
).await?;Re-exports§
pub use detect::detect_challenge;pub use detect::ChallengeKind;pub use detect::DetectionInput;
Modules§
- detect
- Cheap challenge detection — decide whether to invoke the (expensive) solver.
Structs§
- Antibot
- Client for solving bot-detection challenges via Byparr/FlareSolverr.
- Antibot
Builder - Builder for configuring and initializing an
Antibotclient. - Browser
Fingerprint - Cached
Session - Cookie
- HTTP cookie used in solve requests and returned in solutions.
- Debug
Config - Docker
Limits - Resource caps applied to the spawned container.
- Metrics
Snapshot - Read-only point-in-time view of the client’s metrics.
- Proxy
Config - HTTP/SOCKS proxy passed through to the underlying solver (Byparr/FlareSolverr).
- Retry
Policy - Session
Cache Config - Session
Handle - Handle to a provider-side persistent session. Drops auto-destroy the session
on a background task; call
SessionHandle::destroyexplicitly to await. - Solution
- Result of a solve.
responseisNonefor cache hits when only the cookies/user-agent were preserved; checkSolutionSourceto disambiguate. - Solve
Request - A request to solve a challenge.
- Viewport
Enums§
- Antibot
Error - Coalesce
Key - Strategy for grouping in-flight solves.
- Post
Body - Provider
- Docker image provider for the challenge-solving proxy.
- Same
Site - Solution
Source - Where this solution came from.
- Solve
Method
Traits§
- Stream
Ext - Re-export of
futures::StreamExtso callers don’t need a direct dep just to consumeAntibot::solve_stream. An extension trait forStreams that provides a variety of convenient combinator functions.
Functions§
- merge_
cookies - Apply additional cookies to an existing solution.