Skip to content
forked from 0x676e67/rquest

Rust HTTP Client with TLS, JA3/JA4, and HTTP2 fingerprints

License

Notifications You must be signed in to change notification settings

penumbra-x/rquest

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rquest

CI Crates.io License crates.io Crates.io Total Downloads

🚀 Help me work seamlessly with open source sharing by sponsoring me on GitHub

An ergonomic, all-in-one HTTP client for emulating any browser with TLS, JA3/JA4, and HTTP2 fingerprints.

  • Plain, JSON, urlencoded, multipart bodies
  • Header Order
  • Redirect Policy
  • Cookie Store
  • HTTP Proxies
  • WebSocket Upgrade
  • HTTPS via BoringSSL
  • Perfectly Chrome, Safari, and Firefox

Example

This asynchronous example uses Tokio and enables some optional features. Your Cargo.toml could look like this:

[dependencies]
tokio = { version = "1", features = ["full"] }
rquest = "2.0.0"

And then the code:

use rquest::{Client, Emulation};

#[tokio::main]
async fn main() -> Result<(), rquest::Error> {
    // Build a client to emulation Firefox133
    let client = Client::builder()
        .emulation(Emulation::Firefox133)
        .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(())
}

Emulation

  • HTTP/2 over TLS

    JA3/JA4/Akamai fingerprints cannot accurately simulate browser fingerprints due to the sophistication of TLS encryption and the popularity of HTTP/2. rquest does not plan to support parsing these fingerprint strings for simulation. Users are encouraged to customize the configuration according to their own needs.

    Note: Many Akamai fingerprint strings are incomplete. For example, the website lacks Priority and Stream ID in the Headers Frame, making it easy to detect. For details, refer to the HTTP/2 frame parser.

  • Emulation Device

    In fact, most device models have the same TLS/HTTP2 configuration, except that the User-Agent is changed.

    Default device emulation types
    • Chrome

      Chrome100Chrome101Chrome104Chrome105Chrome106Chrome107Chrome108Chrome109Chrome114Chrome116Chrome117Chrome118Chrome119Chrome120Chrome123Chrome124Chrome126Chrome127Chrome128Chrome129Chrome130Chrome131Chrome132Chrome133

    • Edge

      Edge101Edge122Edge127Edge131

    • Safari

      SafariIos17_2SafariIos17_4_1SafariIos16_5Safari15_3Safari15_5Safari15_6_1Safari16Safari16_5Safari17_0Safari17_2_1Safari17_4_1Safari17_5Safari18SafariIPad18, Safari18_2, Safari18_1_1

    • OkHttp

      OkHttp3_9OkHttp3_11OkHttp3_13OkHttp3_14OkHttp4_9OkHttp4_10OkHttp5

    • Firefox

      Firefox109, Firefox117, Firefox128, Firefox133

FFI bindings

  • rnet: Python HTTP client with a touch of black magic.
  • ktor-impersonate: KMP Ktor engine bindings for rquest to spoof JA3/JA4/H2 fingerprints.

Building

Do not compile with packages that depend on openssl-sys; it links with the same prefix symbol as boring-sys, which can cause link failures and other problems. Even if compilation succeeds, using both openssl-sys and boring-sys as dependencies can cause memory segmentation faults.

Install the dependencies required to build BoringSSL

sudo apt-get install build-essential cmake perl pkg-config libclang-dev musl-tools -y

cargo build --release

This GitHub Actions workflow can be used to compile the project on Linux, Windows, and macOS.

License

Released under the Apache-2.0 License.

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

Support this project by becoming a sponsor.

Accolades

The project is based on a fork of reqwest.

About

Rust HTTP Client with TLS, JA3/JA4, and HTTP2 fingerprints

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%