feat(stealth): many stealth improvements

This commit is contained in:
Sander Spilleman authored and GitHub committed 2026-06-03 08:21:14 +00:00
1 parent 1b9be08767
commit 9ae36764da
13 files changed
+190 -731

No files matched your search

+2 -2
View File
@@ -25,7 +25,7 @@ wreq-util = { version = "3.0.0-rc.10", optional = true }
# Enabling it on other platforms produces unresolved `build_script_main_*`
# symbols at link time (see issue #39).
[target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies]
wreq = { version = "6.0.0-rc.28", optional = true, features = ["prefix-symbols"] }
wreq = { version = "6.0.0-rc.28", optional = true, features = ["prefix-symbols", "socks"] }
[target.'cfg(not(any(target_os = "linux", target_os = "android")))'.dependencies]
wreq = { version = "6.0.0-rc.28", optional = true }
wreq = { version = "6.0.0-rc.28", optional = true, features = ["socks"] }
+14
View File
@@ -72,6 +72,20 @@ impl StealthHttpClient {
pub async fn fetch(&self, url: &Url) -> Result<Response, ObscuraNetError> {
let mut current_url = url.clone();
if let Some(host) = current_url.host_str() {
if crate::blocklist::is_blocked(host) {
tracing::debug!("Blocked tracker: {}", current_url);
return Ok(Response {
status: 0,
url: current_url,
headers: HashMap::new(),
body: Vec::new(),
redirected_from: Vec::new(),
});
}
}
let mut redirects = Vec::new();
for _ in 0..20 {