wreq

0x676e67Apache-2.0活跃维护

一个用 Rust 写的 HTTP 客户端,能模拟浏览器 TLS/HTTP2 指纹(JA3/JA4),帮爬虫绕过 Akamai 等反爬检测。

An ergonomic, privacy-aware Rust HTTP Client

v0.16.3发布于 2026-10-30 05:44 UTC1,104star +3 / 7 天144fork同步于 2026-11-10 17:53 UTC

怎么上手

由 README 提炼,执行前请确认
sudo apt-get install build-essential cmake perl pkg-config libclang-dev musl-tools git -y
cargo build --release
硬件要求按 README 说明

README 未说明

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

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

容易踩的坑

MSRV 为 1.98 且使用 Rust 2024 edition,旧工具链无法编译;与 openssl-sys 同时编译可能符号冲突导致链接失败,Linux/Android 需启用 prefix-symbols 特性;需先安装 BoringSSL 构建依赖(cmake、perl、libclang-dev 等)

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v0.16.3
  1. 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::GaiResolver
    • ClientBuilder::timer
    • ClientBuilder::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-rt or compio-rt features; custom DNS resolvers remain supported through ClientBuilder::dns_resolver and Resolve.

    What's Changed

    Full Changelog: https://github.com/0x676e67/wreq/compare/v0.16.1...v0.16.3

  2. v0.16.12026-08-27 · 2026-08-27 02:21 UTC
    查看更新说明

    What's Changed

    New Contributors

    Full Changelog: https://github.com/0x676e67/wreq/compare/v0.16.0...v0.16.1

  3. v0.16.02026-08-22 · 2026-08-22 20:17 UTC
    查看更新说明

    wreq 0.16.0 is the stable release for the work previously published through the 6.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-Age expiration 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 through compio-rt. If you disable default features, enable one runtime explicitly. charset and system-proxy are now opt-in features.
    • The websocket feature is now named ws. The old full and native-roots features have been removed, and query and form are separate features.
    • The old IntoUrl and URL accessors have been replaced by IntoUri, uri(), and uri_mut(). Low-level HTTP and TLS configuration now uses the Http1Options, Http2Options, and TlsOptions APIs.
    • 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 to wreq = "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.

  4. v6.0.0-rc.312026-08-18 · 2026-08-18 18:35 UTC
    查看更新说明

    What's Changed

    New Contributors

    Full Changelog: https://github.com/0x676e67/wreq/compare/v6.0.0-rc.29...v6.0.0-rc.31

  5. v6.0.0-rc.292026-06-03 · 2026-06-03 08:15 UTC
    查看更新说明

    What's Changed

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    wreq

    CI Crates.io License Crates.io MSRV crates.io Discord chat

    🚀 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.

    Dashboard | Docs | Discord


    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.

    Dashboard | Docs | Discord


    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.

    Dashboard | Docs | Discord

    Accolades

    A hard fork of reqwest.