impcurl
Rust WebSocket client with TLS fingerprint impersonation, powered by libcurl-impersonate.
Bypass TLS fingerprinting by impersonating real browser signatures (Chrome, Safari, Firefox, Edge, Tor).
Crates
| Crate | Description |
|---|---|
impcurl-sys |
Dynamic FFI bindings for libcurl-impersonate with auto-fetch |
impcurl |
Safe blocking wrapper — WebSocket handshake, send, recv |
impcurl-ws |
Async tokio Stream + Sink WebSocket connection |
Quick Start
[]
= "0.2"
= "0.3"
= { = "1", = ["macros", "rt-multi-thread"] }
use ;
use ;
async
Builder API
use ImpersonateTarget;
use ;
use Duration;
let ws = builder
.header
.header
.proxy
.impersonate
.connect_timeout
.control_frame_mode
.read_buffer_messages
.write_buffer_messages
.verbose
.connect
.await?;
Runtime Library
The libcurl-impersonate shared library is resolved at runtime in this order:
CURL_IMPERSONATE_LIBenv var- Near executable (
../lib/and side-by-side) IMPCURL_LIB_DIRenv var~/.impcurl/lib,~/.cuimp/binaries- Auto-fetch from curl_cffi wheel (enabled by default)
impcurl-ws does not expose a lib_path(...) builder escape hatch anymore. Runtime library resolution is treated as deployment/runtime configuration rather than a connection-level concern.
Auto-fetch Controls
| Env Var | Description |
|---|---|
IMPCURL_AUTO_FETCH=0 |
Disable auto-download |
IMPCURL_CURL_CFFI_VERSION |
curl_cffi release tag (default 0.11.3) |
IMPCURL_AUTO_FETCH_CACHE_DIR |
Override fetch cache directory |
Architecture
impcurl-ws (async tokio client)
└── impcurl (safe blocking wrapper)
└── impcurl-sys (dynamic FFI + auto-fetch)
└── libcurl-impersonate (runtime .so/.dylib/.dll)
On Unix, the async event loop uses CURLMOPT_SOCKETFUNCTION / CURLMOPT_TIMERFUNCTION with tokio::io::unix::AsyncFd for efficient socket-level readiness notification. Non-Unix falls back to curl_multi_poll.
License
MIT