mirror of
https://github.com/VallierDev/uu-remote-linux.git
synced 2026-11-17 01:00:41 +01:00
Signaling: honor the REST client's opt-in HTTP proxy policy (#123)
Route host and viewer WebSocket signaling through the shared reqwest client so UU_USE_PROXY=1 applies to signaling as well (HTTP/HTTPS proxies only, no direct fallback, no redirects, strict upgrade validation). ICE/WebRTC media is not proxied. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
825f964f7d
commit
d66937a01c
12 files changed
+383
-20
No files matched your search
+5
-2
@@ -163,17 +163,20 @@ fn redact_urls(text: &str) -> String {
|
||||
out
|
||||
}
|
||||
|
||||
/// Cloud API clients ignore ambient HTTP/SOCKS proxy settings by default: a local
|
||||
/// Cloud API and signaling clients ignore ambient HTTP/HTTPS proxy settings by default: a local
|
||||
/// proxy that intercepts TLS breaks login and signaling. `UU_USE_PROXY=1` opts back
|
||||
/// into reqwest's standard proxy environment handling.
|
||||
pub fn http_client_builder() -> reqwest::ClientBuilder {
|
||||
let builder = reqwest::Client::builder();
|
||||
if std::env::var("UU_USE_PROXY").ok().as_deref().is_some_and(proxy_requested) {
|
||||
if proxy_enabled() {
|
||||
builder
|
||||
} else {
|
||||
builder.no_proxy()
|
||||
}
|
||||
}
|
||||
pub(crate) fn proxy_enabled() -> bool {
|
||||
std::env::var("UU_USE_PROXY").ok().as_deref().is_some_and(proxy_requested)
|
||||
}
|
||||
fn proxy_requested(value: &str) -> bool {
|
||||
matches!(value.trim().to_ascii_lowercase().as_str(), "1" | "true" | "yes" | "on")
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user