🚀 Help me work seamlessly with open source sharing by sponsoring me on GitHub
An ergonomic and modular Rust HTTP client for advanced and low-level emulation, with customizable TLS, JA3/JA4, and HTTP/2 fingerprinting capabilities.
- Plain bodies, JSON, urlencoded, multipart
- Cookie Store
- Redirect Policy
- Original Header
- Rotating Proxies
- Certificate Store
- Tower Middleware
- WebSocket Upgrade
- HTTPS via BoringSSL
- HTTP/2 over TLS Emulation
The following example uses the Tokio runtime with optional features enabled by adding this to your Cargo.toml
:
[dependencies]
tokio = { version = "1", features = ["full"] }
wreq = "6.0.0-rc.1"
wreq-util = "3.0.0-rc.1"
And then the code:
use wreq::Client;
use wreq_util::Emulation;
#[tokio::main]
async fn main() -> wreq::Result<()> {
// Build a client
let client = Client::builder()
.emulation(Emulation::Firefox136)
.build()?;
// Use the API you're already familiar with
let resp = client.get("https://tls.peet.ws/api/all").send().await?;
println!("{}", resp.text().await?);
Ok(())
}
- HTTP/2 over TLS
Due to the complexity of TLS encryption and the widespread adoption of HTTP/2, browser fingerprints such as JA3, JA4, and Akamai cannot be reliably emulated using simple fingerprint strings. Instead of parsing and emulating these string-based fingerprints, wreq
provides fine-grained control over TLS and HTTP/2 extensions and settings for precise browser behavior emulation.
- HTTP/3 over QUIC
HTTP/3 over QUIC is a work in progress. Due to the complexity of QUIC and the evolving ecosystem, full HTTP/3 emulation is not yet available in wreq
. If you'd like to accelerate development, please consider sponsoring the project. Progress is tracked at issue #840.
- Device Emulation
Most browser device models share identical TLS and HTTP/2 configurations, differing only in the User-Agent
string. Common browser device emulation templates are maintained in wreq-util
, a companion utility crate.
Avoid compiling with packages that depend on openssl-sys
, as it shares the same prefix symbol with boring-sys
, potentially leading to link failures and other issues. Even if compilation succeeds, using both openssl-sys
and boring-sys
together can result in memory segmentation faults. Until the upstream Boring resolves these linking conflicts, using rustls
is the best workaround.
Install the dependencies required to build BoringSSL
sudo apt-get install build-essential cmake perl pkg-config libclang-dev musl-tools git -y
cargo build --release
This GitHub Actions workflow can be used to compile the project on Linux, Windows, and macOS.
Licensed under either of Apache License, Version 2.0 (LICENSE or http://www.apache.org/licenses/LICENSE-2.0).
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.
CapSolver leverages AI-powered Auto Web Unblock to bypass Captchas effortlessly, providing fast, reliable, and cost-effective data access with seamless integration into Colly, Puppeteer, and Playwright—use code RQUEST
for a 6% bonus!
A hard fork of reqwest.