From b28fbf51f4eb488a941421796c3bd178851a42d2 Mon Sep 17 00:00:00 2001 From: zonyitoo Date: Fri, 19 Dec 2025 03:36:27 +0800 Subject: [PATCH] feat(local-http): HTTP basic auth optimize log (#1994) --- crates/shadowsocks-service/src/config.rs | 2 +- .../src/local/http/http_service.rs | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/crates/shadowsocks-service/src/config.rs b/crates/shadowsocks-service/src/config.rs index 09288f26..f9c13873 100644 --- a/crates/shadowsocks-service/src/config.rs +++ b/crates/shadowsocks-service/src/config.rs @@ -326,7 +326,7 @@ struct SSLocalExtConfig { socks5_auth_config_path: Option, /// HTTP - #[cfg(feature = "local")] + #[cfg(feature = "local-http")] #[serde(skip_serializing_if = "Option::is_none")] http_auth_config_path: Option, diff --git a/crates/shadowsocks-service/src/local/http/http_service.rs b/crates/shadowsocks-service/src/local/http/http_service.rs index 8c3dfe56..5901dfff 100644 --- a/crates/shadowsocks-service/src/local/http/http_service.rs +++ b/crates/shadowsocks-service/src/local/http/http_service.rs @@ -63,20 +63,26 @@ impl HttpService { Some(header_value) => { if let Ok(header_str) = header_value.to_str() { if !self.http_auth.verify_basic_auth(header_str) { - debug!("HTTP {} invalid proxy authorization: {}", req.method(), header_str); + error!( + "HTTP {} URI {} invalid proxy-authorization: {}", + req.method(), + req.uri(), + header_str + ); return make_proxy_authentication_required(); } } else { - debug!( - "HTTP {} invalid proxy authorization header encoding: {:?}", + error!( + "HTTP {} URI {} invalid proxy-authorization header encoding: {:?}", req.method(), + req.uri(), header_value ); return make_proxy_authentication_required(); } } None => { - debug!("HTTP {} missing proxy authorization", req.method()); + error!("HTTP {} URI {} missing proxy-authorization", req.method(), req.uri()); return make_proxy_authentication_required(); } }