
🦀 Stealth HTTP client for Rust . mimics real browser TLS fingerprints for undetectable requests. Fast, type-safe, and built for precision networking.
. An advanced stealth HTTP client for Rust.
Built for privacy-conscious developers who need complete control over their network fingerprint.
Looks like a browser. Acts like a browser. Written in Rust.
Built on bogdanfinn/tls-client - the industry-leading TLS fingerprinting library trusted by security professionals worldwide. We use bogdanfinn's battle-tested shared libraries (.dll/.so/.dylib) through FFI bindings because:
RustTLSX brings this proven technology to Rust with a type-safe, ergonomic API that's 6x faster than Python alternatives.
Modern web applications analyze every aspect of your HTTP requests - not just headers and cookies, but the deep cryptographic signatures of your TLS handshake. Standard Rust HTTP clients (reqwest, hyper, ureq) generate easily detectable patterns that immediately identify automated traffic.
RustTLSX solves this by providing:
Download the required TLS client library for your platform from the tls-client releases:
tls-client-windows-64-1.3.3.dlltls-client-linux-ubuntu-amd64-1.3.3.sotls-client-darwin-amd64-1.3.3.dylibPlace the library file in your project root, system library path (/usr/local/lib/), or ensure it's accessible via PATH.
Add RustTLSX to your Cargo.toml:
[dependencies]
rust-tlsx = "0.1"
use rust_tlsx::{TlsClient, BrowserProfile};
fn main() -> anyhow::Result<()> {
let client = TlsClient::new(BrowserProfile::Firefox120)
.header("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:120.0) Gecko/20100101 Firefox/120.0")
.timeout(30);
let response = client.get("https://example.com")?;
println!("Status: {}", response.status);
println!("Body: {}", response.body);
Ok(())
}
RustTLSX supports over 30 browser profiles across major browsers:
// Chrome versions
BrowserProfile::Chrome103
BrowserProfile::Chrome107
BrowserProfile::Chrome109
BrowserProfile::Chrome120
// Firefox versions
BrowserProfile::Firefox102
BrowserProfile::Firefox105
BrowserProfile::Firefox108
BrowserProfile::Firefox120
// Safari versions
BrowserProfile::Safari15_6_1
BrowserProfile::Safari16_0
BrowserProfile::SafariIos16_0
// Opera and others
BrowserProfile::Opera89
BrowserProfile::Opera90
let client = TlsClient::new(BrowserProfile::Chrome109)
.header("Accept", "application/json")
.header("Accept-Language", "en-US,en;q=0.9")
.cookie("session", "abc123")
.cookie("token", "xyz789");
let response = client.get("https://api.example.com")?;
let body = r#"{"username": "user", "password": "pass"}"#;
let response = client.post("https://example.com/login", Some(body.to_string()))?;
let client = TlsClient::new(BrowserProfile::Firefox120)
.timeout(60); // seconds
let response = client.get("https://slow-api.example.com")?;
RustTLSX is built on a foundation of proven excellence rather than reinventing the wheel. We use bogdanfinn's compiled libraries (.dll/.so/.dylib) through FFI because:
Research Investment: Bogdanfinn has invested thousands of hours reverse-engineering browser TLS behavior. Replicating this research would take years and likely produce inferior results.
Battle-Tested Reliability: These libraries are used by major security firms, privacy tools, and research institutions worldwide. They've been tested against every major protection system.
Continuous Evolution: Browser fingerprints change constantly. Bogdanfinn's libraries receive regular updates to match new browser versions and protection system updates.
Performance Optimization: The native C/Go implementation is heavily optimized for speed and memory efficiency, delivering performance that pure Rust implementations cannot match.
Runtime Dynamic Loading: Libraries are loaded on-demand using FFI, eliminating static linking complexity while maintaining performance.
Memory Management: Rust's ownership model ensures safe interaction with native libraries, preventing memory leaks and use-after-free bugs common in C/C++ implementations.
Error Handling: Comprehensive Result-based error handling provides detailed diagnostics while maintaining type safety.
Connection Management: Intelligent pooling and reuse of TLS connections with browser-accurate behavior patterns.
The underlying libraries manage every aspect of browser TLS behavior:
use rust_tlsx::{TlsClient, BrowserProfile};
fn main() -> anyhow::Result<()> {
let client = TlsClient::new(BrowserProfile::Chrome109);
let response = client.get("https://httpbin.org/get")?;
println!("Status: {}", response.status);
println!("Body: {}", response.body);
Ok(())
}
use rust_tlsx::{TlsClient, BrowserProfile};
fn main() -> anyhow::Result<()> {
let client = TlsClient::new(BrowserProfile::Firefox120);
let response = client.get("https://tls.peet.ws/api/all")?;
println!("TLS Fingerprint Analysis:\n{}", response.body);
Ok(())
}
use rust_tlsx::{TlsClient, BrowserProfile};
fn main() -> anyhow::Result<()> {
let client = TlsClient::new(BrowserProfile::Chrome109)
.header("Authorization", "Bearer YOUR_TOKEN")
.header("Content-Type", "application/json");
let response = client.get("https://api.example.com/data")?;
match response.status {
200 => println!("Success: {}", response.body),
401 => eprintln!("Authentication failed"),
_ => eprintln!("Request failed with status {}: {}", response.status, response.body),
}
Ok(())
}
use rust_tlsx::{TlsClient, BrowserProfile};
fn main() -> anyhow::Result<()> {
// Create a client that appears as a real Firefox browser
let client = TlsClient::new(BrowserProfile::Firefox120)
.header("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:120.0) Gecko/20100101 Firefox/120.0")
.header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8")
.header("Accept-Language", "en-US,en;q=0.5")
.header("Accept-Encoding", "gzip, deflate, br")
.header("DNT", "1") // Privacy-focused: Do Not Track
.timeout(30);
// Include session cookies for authenticated requests
let client = client.cookie("session_id", "your_session_token");
let response = client.get("https://example-site.com/data")?;
match response.status {
200 => println!("Data retrieved successfully with browser-like privacy"),
403 => println!("Authentication required - check session cookies"),
_ => println!("Response: {}", response.status),
}
Ok(())
}
use rust_tlsx::{TlsClient, BrowserProfile};
use std::collections::HashMap;
fn main() -> anyhow::Result<()> {
// Simulate a specific browser environment
let mut headers = HashMap::new();
headers.insert("User-Agent".to_string(),
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36".to_string());
headers.insert("Sec-Fetch-Site".to_string(), "same-origin".to_string());
headers.insert("Sec-Fetch-Mode".to_string(), "navigate".to_string());
headers.insert("Sec-Fetch-Dest".to_string(), "document".to_string());
let client = TlsClient::new(BrowserProfile::Chrome120)
.headers(headers)
.timeout(45);
// Make request that's indistinguishable from real browser
let response = client.get("https://api.example.com/sensitive-data")?;
println!("Retrieved data with perfect browser mimicry");
println!("Protocol used: {}", response.used_protocol);
Ok(())
}
RustTLSX delivers superior performance and privacy compared to all standard Rust HTTP clients:
Zero-Copy Operations: Direct FFI calls to optimized C/Go libraries eliminate unnecessary data copying that plagues pure Rust implementations.
Connection Pooling: Intelligent reuse of TLS connections with browser-accurate keep-alive behavior, reducing handshake overhead by up to 80%.
Memory Efficiency: Rust's ownership model combined with optimized native libraries results in 40% lower memory usage than equivalent Python solutions.
Concurrent Performance: Native async support with proper connection multiplexing scales linearly with CPU cores.
vs Python tls-client bindings:
vs Go tls-client:
vs Node.js solutions:
Download the appropriate binary from tls-client releases:
tls-client-windows-64-1.3.3.dlltls-client-linux-ubuntu-amd64-1.3.3.sotls-client-darwin-amd64-1.3.3.dylibPlace the library file in your project root, system library directory, or ensure it's accessible via PATH.
[dependencies]
rust-tlsx = "0.1"
anyhow = "1.0"
use rust_tlsx::{TlsClient, BrowserProfile};
fn main() -> anyhow::Result<()> {
let client = TlsClient::new(BrowserProfile::Firefox120);
let response = client.get("https://example.com")?;
println!("Status: {}", response.status);
Ok(())
}
The main client interface for making HTTP requests with browser-like TLS fingerprints.
impl TlsClient {
pub fn new(profile: BrowserProfile) -> Self
pub fn header(self, key: &str, value: &str) -> Self
pub fn headers(self, headers: HashMap<String, String>) -> Self
pub fn cookie(self, name: &str, value: &str) -> Self
pub fn cookies(self, cookies: Vec<CookieInput>) -> Self
pub fn timeout(self, seconds: i32) -> Self
pub fn get(&self, url: &str) -> Result<Response>
pub fn post(&self, url: &str, body: Option<String>) -> Result<Response>
}
Enumeration of available browser fingerprint profiles:
pub enum BrowserProfile {
// Chrome versions
Chrome103, Chrome104, Chrome105, Chrome106,
Chrome107, Chrome108, Chrome109, Chrome120,
// Firefox versions
Firefox102, Firefox104, Firefox105, Firefox106,
Firefox108, Firefox120,
// Safari versions
Safari15_6_1, Safari16_0,
SafariIpad15_6, SafariIos15_5, SafariIos15_6, SafariIos16_0,
// Opera versions
Opera89, Opera90, Opera91,
}
HTTP response structure returned by client methods:
pub struct Response {
pub status: i32, // HTTP status code
pub used_protocol: String, // Protocol used ("h2" or "http/1.1")
pub body: String, // Response body content
pub headers: HashMap<String, Vec<String>>, // Response headers
pub cookies: HashMap<String, String>, // Set-Cookie values
}
Error: Failed to load library: cannot find tls-client-*.dll
Solutions:
/usr/local/lib/ on Linux/macOS)Even with authentic TLS fingerprints, additional factors may be required:
Required Components:
Complete Example:
let client = TlsClient::new(BrowserProfile::Firefox120)
.header("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:120.0) Gecko/20100101 Firefox/120.0")
.header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8")
.header("Accept-Language", "en-US,en;q=0.5")
.header("Accept-Encoding", "gzip, deflate, br")
.header("Connection", "keep-alive")
.header("Upgrade-Insecure-Requests", "1");
git clone https://github.com/yourusername/rust-tlsx
cd rust-tlsx
# Download required TLS library
wget https://github.com/bogdanfinn/tls-client/releases/download/v1.3.3/tls-client-windows-64-1.3.3.dll
# Build the project
cargo build --release
# Run tests
cargo test
cargo run --example simple_request
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
Areas for improvement:
Licensed under either of:
The underlying TLS client library uses the BSD-4-Clause license.
| Library | TLS Fingerprint | Performance | Privacy Level | Memory Usage |
|---|
reqwest + rustls | Detectable Rust signature | Baseline | Low | High |
reqwest + native-tls | System TLS (detectable) | Baseline | Low | High |
hyper + hyper-tls | Generic HTTP/2 | Fast | Low | Medium |
ureq | Basic TLS 1.2/1.3 | Slow | Low | Low |
rust-tlsx | Perfect browser mimicry | 6x faster | Maximum | Optimized |