MSRV 为 1.98 且使用 Rust 2024 edition,旧工具链无法编译;与 openssl-sys 同时编译可能符号冲突导致链接失败,Linux/Android 需启用 prefix-symbols 特性;需先安装 BoringSSL 构建依赖(cmake、perl、libclang-dev 等)
wreq
0x676e67Apache-2.0活跃维护一个用 Rust 写的 HTTP 客户端,能模拟浏览器 TLS/HTTP2 指纹(JA3/JA4),帮爬虫绕过 Akamai 等反爬检测。
An ergonomic, privacy-aware Rust HTTP Client
sudo apt-get install build-essential cmake perl pkg-config libclang-dev musl-tools git -y
cargo build --releaseREADME 未说明
Rust HTTP 客户端,可精细控制 TLS 与 HTTP/2 指纹,用于高保真模拟浏览器协议
一个用 Rust 写的 HTTP 客户端,能模拟浏览器 TLS/HTTP2 指纹(JA3/JA4),帮爬虫绕过 Akamai 等反爬检测。
核心能力
- 保留 HTTP/1 头部大小写,避免 WAF 拒绝小写头请求
- 细粒度控制 TLS 与 HTTP/2 扩展和设置以模拟浏览器
- 内置 wreq-util 提供 100+ 浏览器设备模拟配置
- 支持 Cookie 存储、重定向策略、轮换代理与 Tower 中间件
- 支持 WebSocket 升级、HTTP Trailer 与多运行时 Tokio/Compio
容易踩的坑
- v0.16.3最新正式版2026-10-30 · 2026-10-30 05:44 UTC
Runtime API removals
The following runtime implementation APIs were accidentally exposed and are removed in this patch release:
wreq::dns::GaiResolverClientBuilder::timerClientBuilder::executor
These APIs expose unstable runtime internals. Configuring timers or executors independently can mix components from different runtimes or pair them with an incompatible runtime context. They are removed to keep runtime selection consistent and avoid unsupported combinations.
Code using these APIs must be updated. Select the built-in runtime through the
tokio-rtorcompio-rtfeatures; custom DNS resolvers remain supported throughClientBuilder::dns_resolverandResolve.What's Changed
- test(0.16.x): fix nightly clippy warning by @0x676e67 in https://github.com/0x676e67/wreq/pull/1335
- backport(0.16.x): fix(redirect): accept UTF-8 Location headers by @0x676e67 in https://github.com/0x676e67/wreq/pull/1336
- backport(0.16.x): fix(ws): classify WebSocket read errors as websocket errors by @0x676e67 in https://github.com/0x676e67/wreq/pull/1337
- backport(0.16.x): feat(cookie): expose storage host in Jar::get_all by @0x676e67 in https://github.com/0x676e67/wreq/pull/1338
- backport(0.16.x): fix(timeout): start read timeout when polling next frame by @0x676e67 in https://github.com/0x676e67/wreq/pull/1350
- backport(0.16.x): fix(conn): build on targets without keepalive interval and retries by @0x676e67 in https://github.com/0x676e67/wreq/pull/1351
- backport(0.16.x): build(deps): bump lru from 0.18.5 to 0.19.0 by @0x676e67 in https://github.com/0x676e67/wreq/pull/1354
- backport(0.16.x): fix(request): append query parameters without replacing existing values by @0x676e67 in https://github.com/0x676e67/wreq/pull/1352
- chore: release v0.16.2 by @0x676e67 in https://github.com/0x676e67/wreq/pull/1332
- backport(0.16.x): feat(tls): add
CertStoreBuilder::verify_hostby @0x676e67 in https://github.com/0x676e67/wreq/pull/1365 - backport(0.16.x): ci: add PR template verification by @0x676e67 in https://github.com/0x676e67/wreq/pull/1364
- backport(0.16.x): fix(rt): remove accidentally exposed runtime APIs by @0x676e67 in https://github.com/0x676e67/wreq/pull/1367
- chore: release v0.16.3 by @0x676e67 in https://github.com/0x676e67/wreq/pull/1366
Full Changelog: https://github.com/0x676e67/wreq/compare/v0.16.1...v0.16.3
- v0.16.12026-08-27 · 2026-08-27 02:21 UTC
查看更新说明
What's Changed
- fix(ci): avoid duplicate release PRs by @0x676e67 in https://github.com/0x676e67/wreq/pull/1259
- docs(readme): update stable release versions by @0x676e67 in https://github.com/0x676e67/wreq/pull/1261
- docs(readme): show latest published MSRV by @0x676e67 in https://github.com/0x676e67/wreq/pull/1262
- fix(timeout): preserve total timeout across response head and body by @eav93 in https://github.com/0x676e67/wreq/pull/1263
- fix(connect): drive connect_timeout with the configured timer by @Xerxes-2 in https://github.com/0x676e67/wreq/pull/1264
- fix(decoder): use identity encoding for range requests by @0x676e67 in https://github.com/0x676e67/wreq/pull/1265
- chore: release v0.16.1 by @0x676e67 in https://github.com/0x676e67/wreq/pull/1260
New Contributors
- @eav93 made their first contribution in https://github.com/0x676e67/wreq/pull/1263
Full Changelog: https://github.com/0x676e67/wreq/compare/v0.16.0...v0.16.1
- v0.16.02026-08-22 · 2026-08-22 20:17 UTC
查看更新说明
wreq 0.16.0is the stable release for the work previously published through the6.0.0-rc.*line. The move to 0.16 reflects that the public API is still evolving before 1.0. This is a version-number reset, not a return to an older codebase. See the migration notice for the version mapping.Much of this release cycle rebuilt the client around Tower middleware and moved the core HTTP implementation into
wreq-proto. That work produced a long PR history, but most of it was internal. The changes users are more likely to notice are:- Requests and responses now use
http::Uri. Request extensions are public, and emulation, header order, redirects, and other behavior can be adjusted per request or through custom Tower middleware. - HTTP/1 and HTTP/2 received fixes for body reads, wakeups, trailers, and cancellation. Multi-address connections now race within one connect timeout, and Windows system proxy rules handle IP wildcards correctly.
- TLS configuration now includes peer certificate chains, certificate compression, and a pluggable session cache. The TLS backend moved to
btls, with optional symbol prefixing for applications that also link another OpenSSL implementation. - Cookie domain matching and
Max-Ageexpiration were corrected, and the cookie jar has a smaller, more direct API. Responses expose trailers and connection recycling control, while WebSocket users can take ownership of the underlying stream.
Before upgrading
- The minimum supported Rust version is 1.98.
- Tokio is the default runtime through
tokio-rt, and Compio is available throughcompio-rt. If you disable default features, enable one runtime explicitly.charsetandsystem-proxyare now opt-in features. - The
websocketfeature is now namedws. The oldfullandnative-rootsfeatures have been removed, andqueryandformare separate features. - The old
IntoUrland URL accessors have been replaced byIntoUri,uri(), anduri_mut(). Low-level HTTP and TLS configuration now uses theHttp1Options,Http2Options, andTlsOptionsAPIs. - Users coming from 5.x should treat this as a breaking upgrade. If you already use
6.0.0-rc.31, update the dependency requirement towreq = "0.16".
Thanks to @incizzle, @blinjrm, @Abernson, @sqdshguy, @Xerxes-2, @uselessgoddess, and @yuzheng14 for their first contributions during this release cycle, and to everyone who tested the RC builds.
- Requests and responses now use
- v6.0.0-rc.312026-08-18 · 2026-08-18 18:35 UTC
查看更新说明
What's Changed
- bench: add single-threaded benchmark for
cyperHTTP Client by @0x676e67 in https://github.com/0x676e67/wreq/pull/1195 - feat(dns): implement
Error::is_dns()to detect DNS resolve failures by @0x676e67 in https://github.com/0x676e67/wreq/pull/1201 - test(badssl): add test case for wrong host on BadSSL by @0x676e67 in https://github.com/0x676e67/wreq/pull/1202
- test(badssl): retry on
badssl.comconnection reset errors by @0x676e67 in https://github.com/0x676e67/wreq/pull/1207 - test: fix clippy lints for Rust 1.97.0 by @0x676e67 in https://github.com/0x676e67/wreq/pull/1213
- fix(cookie): correct domain matching by @0x676e67 in https://github.com/0x676e67/wreq/pull/1211
- fix(cookie): enforce max-age expiration by @0x676e67 in https://github.com/0x676e67/wreq/pull/1214
- feat(cookie): expand cookie jar APIs by @0x676e67 in https://github.com/0x676e67/wreq/pull/1216
- feat(socket): tcp SO_LINGER option by @uselessgoddess in https://github.com/0x676e67/wreq/pull/1217
- refactor(redirect): simplify internal abstractions for redirect handling by @0x676e67 in https://github.com/0x676e67/wreq/pull/1200
- ci: use nightly for style checks by @0x676e67 in https://github.com/0x676e67/wreq/pull/1222
- build(deps): bump taiki-e/install-action from 2 to 2.85.5 by @dependabot[bot] in https://github.com/0x676e67/wreq/pull/1223
- feat(redirect): apply referrer policy across redirects by @0x676e67 in https://github.com/0x676e67/wreq/pull/1221
- fix(socket): race resolved addresses within connect timeout by @0x676e67 in https://github.com/0x676e67/wreq/pull/1224
- build(deps): bump actions/checkout from 6 to 7 by @dependabot[bot] in https://github.com/0x676e67/wreq/pull/1203
- refactor(util): centralize IPv6 bracket parsing by @0x676e67 in https://github.com/0x676e67/wreq/pull/1227
- fix(proxy): handle WinINET IP wildcards by @0x676e67 in https://github.com/0x676e67/wreq/pull/1226
- docs: restore doc_cfg feature gate by @yuzheng14 in https://github.com/0x676e67/wreq/pull/1228
- perf(body): reuse read timeout timer by @0x676e67 in https://github.com/0x676e67/wreq/pull/1230
- build(deps): bump taiki-e/install-action from 2.85.5 to 2.85.10 by @dependabot[bot] in https://github.com/0x676e67/wreq/pull/1229
- refactor(body): use absolute read timeout deadline by @0x676e67 in https://github.com/0x676e67/wreq/pull/1231
- chore: add pull request template for human-written content by @0x676e67 in https://github.com/0x676e67/wreq/pull/1232
- fix(error): classify read timeout as body error by @0x676e67 in https://github.com/0x676e67/wreq/pull/1233
- docs(request): document JSON content type by @0x676e67 in https://github.com/0x676e67/wreq/pull/1235
- test(redirect): cover sensitive headers on scheme changes by @0x676e67 in https://github.com/0x676e67/wreq/pull/1236
- fix(release): restore changelog parsing by @0x676e67 in https://github.com/0x676e67/wreq/pull/1244
- chore: release v6.0.0-rc.31 by @0x676e67 in https://github.com/0x676e67/wreq/pull/1243
New Contributors
- @uselessgoddess made their first contribution in https://github.com/0x676e67/wreq/pull/1217
- @yuzheng14 made their first contribution in https://github.com/0x676e67/wreq/pull/1228
Full Changelog: https://github.com/0x676e67/wreq/compare/v6.0.0-rc.29...v6.0.0-rc.31
- bench: add single-threaded benchmark for
- v6.0.0-rc.292026-06-03 · 2026-06-03 08:15 UTC
查看更新说明
What's Changed
- perf(request): static init for common content-type header by @0x676e67 in https://github.com/0x676e67/wreq/pull/1060
- perf(error): hint compiler to inline trivial error-handling functions by @0x676e67 in https://github.com/0x676e67/wreq/pull/1061
- perf(response): hint compiler to inline trivial response-handling functions by @0x676e67 in https://github.com/0x676e67/wreq/pull/1062
- perf(http2): backport and apply hyper client's H2 configuration by @0x676e67 in https://github.com/0x676e67/wreq/pull/1063
- fix(rt): support fake time in legacy client and TokioTimer by @0x676e67 in https://github.com/0x676e67/wreq/pull/1064
- bench: add benchmarks for HTTP/1.1 and HTTP/2 by @0x676e67 in https://github.com/0x676e67/wreq/pull/1065
- build(deps): replace
schnellruwithlruimplementation by @0x676e67 in https://github.com/0x676e67/wreq/pull/1066 - docs: clarify symbol conflict with OpenSSL by @0x676e67 in https://github.com/0x676e67/wreq/pull/1068
- bench: Add benchmarks for full and streaming bodies by @0x676e67 in https://github.com/0x676e67/wreq/pull/1069
- fix(http2): prevent panic when calling to_str on non-UTF8 headers by @0x676e67 in https://github.com/0x676e67/wreq/pull/1070
- chore: lint core by @0x676e67 in https://github.com/0x676e67/wreq/pull/1071
- build(deps): bump nttld/setup-ndk from 1.5.0 to 1.6.0 by @dependabot[bot] in https://github.com/0x676e67/wreq/pull/1072
- perf(bench): optimize benchmark server by @0x676e67 in https://github.com/0x676e67/wreq/pull/1073
- fix: disable Nagle's algorithm to resolve HTTP/2 performance dip by @0x676e67 in https://github.com/0x676e67/wreq/pull/1074
- bench: improve benchmark test coverage by @0x676e67 in https://github.com/0x676e67/wreq/pull/1075
- docs(hash): simplify documentation for
HashMemocreation by @0x676e67 in https://github.com/0x676e67/wreq/pull/1076 - build(deps): replace
raw-cpuidwithsysinfoimplementation by @0x676e67 in https://github.com/0x676e67/wreq/pull/1077 - fix(bench): fix CPU sysinfo reading in benchmark by @0x676e67 in https://github.com/0x676e67/wreq/pull/1080
- bench: add missing
TokioTimerto http1 server builder by @0x676e67 in https://github.com/0x676e67/wreq/pull/1081 - feat(cookie): fill missing domain/path in
get_allfrom stored scope by @0x676e67 in https://github.com/0x676e67/wreq/pull/1082 - build(deps): migrate from
boring2tobtlsby @0x676e67 in https://github.com/0x676e67/wreq/pull/1083 - build(deps): replace
ahashwithfoldhashinlrucache by @0x676e67 in https://github.com/0x676e67/wreq/pull/1084 - perf(http1): eliminate
ParserConfigclones on the HTTP/1.1 request hot path by @0x676e67 in https://github.com/0x676e67/wreq/pull/1088 - build(deps): bump btls from 0.5.3 to 0.5.4 by @0x676e67 in https://github.com/0x676e67/wreq/pull/1090
- perf(buf): make
BufList::remainingO(1) by caching length by @0x676e67 in https://github.com/0x676e67/wreq/pull/1091 - feat(multipart): add Form::set_boundary for custom boundaries by @sqdshguy in https://github.com/0x676e67/wreq/pull/1094
- perf(multipart): Improve memory layout of
multipart::Formby @0x676e67 in https://github.com/0x676e67/wreq/pull/1095 - refactor(conn): modular connector component by @0x676e67 in https://github.com/0x676e67/wreq/pull/1100
- feat(tls): allow pluggable TLS session cache by @0x676e67 in https://github.com/0x676e67/wreq/pull/1101
- fix(tcp): restore the missing TCP nodelay setting by @0x676e67 in https://github.com/0x676e67/wreq/pull/1102
- refactor(pool): redesign emulation and pool ID strategy by @0x676e67 in https://github.com/0x676e67/wreq/pull/1103
- refactor(tls): expose certificate compression APIs by @0x676e67 in https://github.com/0x676e67/wreq/pull/1085
- refactor(tls): decouple TLS backend logic into sub-modules by @0x676e67 in https://github.com/0x676e67/wreq/pull/1105
- feat(cookie): RFC 9113 compliant cookie handling by @0x676e67 in https://github.com/0x676e67/wreq/pull/1106
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
wreq
🚀 Help me work seamlessly with open source sharing by sponsoring me on GitHub
An ergonomic and modular Rust HTTP Client for high-fidelity protocol matching, featuring customizable TLS, JA3/JA4, and HTTP/2 signature capabilities.
Features
- Plain bodies, JSON, urlencoded, multipart
- HTTP Trailer
- Cookie Store
- Redirect Policy
- Original Header
- Rotating Proxies
- Tower Middleware
- WebSocket Upgrade
- HTTPS via BoringSSL
- HTTP/2 over TLS Parity
- Certificate Store (CAs & mTLS)
- Multiple Runtime (Tokio, Compio)
Example
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 = "0.16"
wreq-util = "0.2"
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::Safari26)
.build()?;
// Use the API you're already familiar with
let resp = client.get("https://pingly.us.kg/api/all").send().await?;
println!("{}", resp.text().await?);
Ok(())
}
Behavior
- HTTP/1 over TLS
In the Rust ecosystem, most HTTP clients rely on the http library, which performs well but does not preserve header case. This causes some WAFs to reject HTTP/1 requests with lowercase headers (see discussion). wreq addresses this by fully supporting HTTP/1 header case sensitivity.
- 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.
- Device Emulation
TLS and HTTP/2 fingerprints are often identical across various browser models because these underlying protocols evolve slower than browser release cycles. 100+ browser device emulation profiles are maintained in wreq-util.
MSRV and Edition
The current MSRV is 1.98. The current edition is Rust 2024.
wreq has a rolling MSRV (Minimum Supported Rust Version) policy to support the current and previous Rust
compiler versions, and the latest edition of Rust.
We may periodically lag the MSRV behind this latest version/edition in rare cases for our dependencies to catch up and for us to perform any necessary fixes.
Building
Compiling alongside openssl-sys can cause symbol conflicts with boringssl that lead to link failures, and on Linux and Android this can be avoided by enabling the prefix-symbols feature.
Install BoringSSL build dependencies and build with:
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.
Services
Help sustain the ongoing development of this open-source project by reaching out for commercial support. Receive private guidance, expert reviews, or direct access to the maintainer, with personalized technical assistance tailored to your needs.
License
Licensed under either of Apache License, Version 2.0 (LICENSE or http://www.apache.org/licenses/LICENSE-2.0).
Contribution
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.
Sponsors
Solve reCAPTCHA in less than 2 seconds
Captcha.fun delivers fast, reliable CAPTCHA solving built for automation at scale.
With simple API integration, consistent performance, and competitive pricing, it's an easy way to keep your workflows moving without delays—use code WREQ for 10% bonus credits.
35M+ residential IPs with 99.9% success rates
UK-based Byteful provides ethically sourced residential, mobile, static residential (ISP), and datacenter proxies. Its API-first scraping, data collection, and AI automation tools handle tens of billions of monthly requests.
With free geo-targeting and ~0.5s response times, Byteful helps you collect data at scale. Use code WREQ10 for 10% off residential proxies.
TLS fingerprinting alone isn't enough for modern bot protection. Hyper Solutions provides the missing piece - API endpoints that generate valid antibot tokens for:
Akamai • DataDome • Kasada • Incapsula
No browser automation. Just simple API calls that return the exact cookies and headers these systems require.
Accolades
A hard fork of reqwest.