diff --git a/Cargo.toml b/Cargo.toml index ebdb8d3..90e073f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,7 @@ servo_arc = "0.4" cssparser = "0.34" tokio = { version = "1", features = ["full"] } tokio-tungstenite = "0.26" -reqwest = { version = "0.12", features = ["cookies", "gzip", "brotli", "deflate", "native-tls-vendored"], default-features = false } +reqwest = { version = "0.12", features = ["cookies", "gzip", "brotli", "deflate", "native-tls-vendored", "socks"], default-features = false } serde = { version = "1", features = ["derive"] } serde_json = "1" url = "2" diff --git a/crates/obscura-browser/src/page.rs b/crates/obscura-browser/src/page.rs index 94fb566..a7c5082 100644 --- a/crates/obscura-browser/src/page.rs +++ b/crates/obscura-browser/src/page.rs @@ -54,7 +54,14 @@ impl Page { let frame_id = id.clone(); #[cfg(feature = "stealth")] let stealth_client = if context.stealth { - Some(Arc::new(StealthHttpClient::new(context.cookie_jar.clone()))) + // wreq doesn't support SOCKS5; Clash mixed port handles both. + let stealth_proxy = context.proxy_url.as_ref().map(|u| { + u.replacen("socks5://", "http://", 1) + }); + Some(Arc::new(StealthHttpClient::with_proxy( + context.cookie_jar.clone(), + stealth_proxy.as_deref(), + ))) } else { None };