refactor: migrate proxy setting guard to sysproxy-rs crate (#5287)

* Refactor proxy management: Remove EventDrivenProxyManager and async_proxy_query

- Removed the EventDrivenProxyManager and its related event-driven proxy management logic.
- Replaced usages of AsyncProxyQuery with direct calls to sysproxy for fetching system and auto proxy configurations.
- Cleaned up constants by removing unused default proxy host.
- Updated sysopt to eliminate calls to the removed EventDrivenProxyManager.
- Adjusted logging and proxy state management to reflect the removal of event-driven architecture.
- Simplified the core module structure by removing unnecessary module imports.

* refactor: remove bypass module for cleaner network configuration

* feat: update sysproxy to version 0.4.0 and add guard feature; refactor sysopt for improved proxy management

* feat(windows/sysproxy): unify guard-type handling and auto-restore drift

* refactor(config): remove commented-out code for SysProxy update flag

---------

Co-authored-by: Slinetrac <realakayuki@gmail.com>
This commit is contained in:
Tunglies
2025-11-15 20:51:36 +08:00
committed by GitHub
parent e021e45e9a
commit 8654bad6b0
12 changed files with 132 additions and 1198 deletions

View File

@@ -1,7 +1,6 @@
use std::time::Duration;
pub mod network {
pub const DEFAULT_PROXY_HOST: &str = "127.0.0.1";
pub const DEFAULT_EXTERNAL_CONTROLLER: &str = "127.0.0.1:9097";
pub mod ports {
@@ -20,18 +19,6 @@ pub mod network {
}
}
pub mod bypass {
#[cfg(target_os = "windows")]
pub const DEFAULT: &str = "localhost;127.*;192.168.*;10.*;172.16.*;172.17.*;172.18.*;172.19.*;172.20.*;172.21.*;172.22.*;172.23.*;172.24.*;172.25.*;172.26.*;172.27.*;172.28.*;172.29.*;172.30.*;172.31.*;<local>";
#[cfg(target_os = "linux")]
pub const DEFAULT: &str =
"localhost,127.0.0.1,192.168.0.0/16,10.0.0.0/8,172.16.0.0/12,172.29.0.0/16,::1";
#[cfg(target_os = "macos")]
pub const DEFAULT: &str = "127.0.0.1,192.168.0.0/16,10.0.0.0/8,172.16.0.0/12,172.29.0.0/16,localhost,*.local,*.crashlytics.com,<local>";
}
pub mod timing {
use super::Duration;