Specter
HTTP client that accurately replicates Chrome's TLS and HTTP/2 behavior, letting you automate browser workflows programmatically.
What This Is
Specter implements HTTP/1.1, HTTP/2, and HTTP/3 with the same protocol fingerprints as Chrome. It's written in Rust with a custom HTTP/2 implementation built from RFC 9113 (we don't use hyper or the h2 crate). TLS uses BoringSSL - Chrome's actual TLS library. When you make requests with Specter, fingerprinting systems see the same signatures they'd see from a real Chrome browser. Validated against ScrapFly, Browserleaks, and tls.peet.ws.
Supported Chrome fingerprints: 142, 143, 144, 145, 146 (current stable). Firefox 133 also supported.
[]
= "1.0"
Usage
Basic request
use ;
async
Force a specific HTTP version
use HttpVersion;
// HTTP/2 only
client.get.version.send.await?;
// HTTP/3 with H1/H2 fallback
client.get.version.send.await?;
Configure the client builder
use ;
use Http2Settings;
use PseudoHeaderOrder;
use Duration;
let client = builder
.fingerprint
.prefer_http2 // advertise h2 first and reuse pooled connections
.timeout
.http2_settings
.pseudo_order
.h3_upgrade // cache Alt-Svc upgrades
.build?;
fingerprint(FingerprintProfile::Chrome146)selects the TLS and HTTP/2 fingerprints that match shipping Chrome 146. Other versions available:Chrome142,Chrome143,Chrome144,Chrome145.prefer_http2(true)keeps HTTP/1.1 available through ALPN but defaults to pooled HTTP/2.timeout(...)adds a global request timeout enforced across all transports.http2_settings(...)/pseudo_order(...)let you override SETTINGS frames and pseudo header ordering when you need to mimic a different browser or experiment with fingerprints.h3_upgrade(false)disables Alt-Svc based HTTP/3 upgrades if you want deterministic TCP-only behavior.
Redirects, retries, and cookies stay under your control
Specter never follows redirects or stores cookies automatically by default. That is intentional so you can replay the exact browser flow the target expects. You can opt in:
use RedirectPolicy;
let client = builder
.redirect_policy
.cookie_store
.build?;
Use CookieJar plus the header helpers to implement whatever policy you need:
use ;
use ;
use Url;
async
Use response.is_redirect()/response.redirect_url() to drive your redirect engine, and response.url() if you need to report the final hop back to upstream logic.
Persist cookies between runs
CookieJar understands the standard Netscape cookie format so you can import/export Chrome cookies or maintain your own store:
let mut jar = new;
jar.load_from_file.await?;
// ... run requests and call jar.store_from_headers(...)
jar.save_to_file.await?;
Header presets & origin helpers
specter::headers ships Chrome 142-146 navigation, AJAX, and form presets plus helpers such as with_origin, with_referer, with_cookies, and headers_to_owned. Start from those presets, then add per-request headers so you never accidentally send forbidden connection-specific headers on HTTP/2/3.
Response helpers
Response::decoded_body(), Response::text(), and Response::json() transparently decompress gzip/deflate/br/zstd payloads (including chained encodings) before decoding, which matches modern browser behavior.
Implementation
HTTP/1.1 - Direct socket implementation, no hyper dependency.
HTTP/2 - Custom implementation because the h2 crate doesn't expose SETTINGS frame order, GREASE support, or connection preface timing. Fingerprinting systems check all of this. We implemented HTTP/2 from RFC 9113 with fluke-hpack for HPACK compression. This gives us:
- Correct SETTINGS order:
1:65536;2:0;3:1000;4:6291456;5:16384;6:262144 - GREASE support (
0x0a0a:0setting) - Chrome pseudo-header order (m,s,a,p)
- WINDOW_UPDATE: 15663105 (Chrome's connection window)
- All headers properly lowercased per RFC 7540/9113
- True multiplexing (concurrent requests on single connection, respecting
MAX_CONCURRENT_STREAMS)
HTTP/3 - QUIC transport via quiche with TLS 1.3 fingerprinting.
TLS - BoringSSL configured with Chrome cipher suites, curves, and signature algorithms. The TLS configuration is identical across Chrome 142-146. BoringSSL does its own extension randomization (which matches Chrome's behavior for TLS 1.3).
Control - Nothing happens automatically. You manage redirects, cookies, headers, and retries explicitly (see the examples above for recommended patterns).
Testing & Validation
Specter is validated against production fingerprinting services:
- ScrapFly (tools.scrapfly.io) - matches Chrome fingerprint
- Browserleaks (tls.browserleaks.com) - TLS fingerprint validation
- tls.peet.ws - HTTP/2 Akamai fingerprint validation
- Cloudflare - HTTP/3 support
Local/CI checks:
cargo test -p specterexercises the cookie jar, header filtering, and transport layers.cargo run --example fingerprint_validationhits ScrapFly, BrowserLeaks, tls.peet.ws, and Cloudflare to confirm TLS/HTTP/2/HTTP/3 fingerprints.cargo run --example protocol_test -- --verbosewalks through HTTP/1.1 preference, HTTP/2 pooling, HTTP/3 only, and connection header filtering. Pass--target example.comto test a custom origin.cargo clippy -p specter -- -D warningsstays clean to make CI fail-fast on regressions.
Development
Pre-commit Hooks
This project uses pre-commit to automatically format code and run clippy before commits. Install it once:
# Install pre-commit (if not installed)
# Install hooks in this repo
After installation, cargo fmt and cargo clippy will run automatically on each commit. To run manually:
Versioning & Stability
- We follow SemVer. API breaking changes will require a major version bump while fingerprint profile additions remain additive.
Responsible Use
Specter makes it easy to mimic real Chrome traffic. Please use it responsibly:
- Only target hosts you own or have written permission to test, and obey their terms of service plus local laws.
- Make it clear in your own product documentation that requests are automated; do not use Specter to impersonate real end users.
- Respect robots.txt, rate limits, and authentication boundaries—Specter gives you the tools but you are accountable for policy.
- Keep your own audit logs so you can answer abuse reports quickly.
License
MIT