9 releases (5 stable)
Uses new Rust 2024
| new 2.0.0 | Feb 19, 2026 |
|---|---|
| 1.4.0 | Feb 13, 2026 |
| 0.1.5 | Feb 3, 2026 |
| 0.1.4 | Jan 13, 2026 |
#725 in HTTP client
1.5MB
30K
SLoC
hpx-util
Common utilities for the hpx HTTP client.
Features
- Browser Emulation: TLS fingerprinting and HTTP/2 settings emulation for Chrome, Firefox, Safari, Opera, and OkHttp
- Tower Middleware: Delay and jitter layers for Tower services
Quick Start
use hpx_util::Emulation;
#[tokio::main]
async fn main() -> hpx::Result<()> {
let resp = hpx::get("https://tls.peet.ws/api/all")
.emulation(Emulation::Firefox136)
.send()
.await?;
println!("{}", resp.text().await?);
Ok(())
}
Feature Flags
| Feature | Default | Description |
|---|---|---|
emulation |
Yes | Browser emulation profiles (Chrome, Firefox, Safari, Opera, OkHttp) |
emulation-compression |
No | Compression settings for emulation profiles |
emulation-rand |
No | Random emulation profile selection |
emulation-serde |
No | Serde serialization for emulation types |
tower-delay |
No | Delay/jitter Tower middleware layer |
Emulation Profiles
The emulation feature provides pre-configured browser fingerprint profiles:
- Chrome: Multiple versions with accurate TLS/HTTP2 settings
- Firefox: Firefox browser emulation
- Safari: Safari browser emulation
- Opera: Opera browser emulation
- OkHttp: OkHttp client emulation
Tower Middleware
The tower-delay feature provides:
DelayLayer— Fixed delay middlewareDelayLayerWith— Configurable delay with jitter
License
Apache-2.0
Dependencies
~32–48MB
~1M SLoC