From 84312a5cd171b338663c347d3182bd162306801f Mon Sep 17 00:00:00 2001 From: MrHard <74858909+mrhard9090@users.noreply.github.com> Date: Sat, 10 Oct 2026 16:32:27 +0000 Subject: [PATCH] fix(sysproxy): bypass *.local by default on Windows (#8054) Hostnames such as mi13.local are resolved by mDNS on the local network, which the proxy core cannot do, so they failed with 'couldn't find ip' while the system proxy was on. The macOS default already bypasses *.local. Co-authored-by: Claude Opus 5.5 --- Changelog.md | 4 ++++ src-tauri/src/core/sysopt.rs | 2 +- src/components/setting/mods/sysproxy-viewer.tsx | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Changelog.md b/Changelog.md index 9fc2ff1fc..94b6045e2 100644 --- a/Changelog.md +++ b/Changelog.md @@ -16,4 +16,8 @@ 🚀 优化改进 +**🖥️ Windows** + +- Windows 系统代理默认绕过 `*.local` 域名,访问局域网设备的 `.local` 主机名时不再经过代理 + diff --git a/src-tauri/src/core/sysopt.rs b/src-tauri/src/core/sysopt.rs index 140e1d089..9b3d158dc 100644 --- a/src-tauri/src/core/sysopt.rs +++ b/src-tauri/src/core/sysopt.rs @@ -261,7 +261,7 @@ impl Default for Sysopt { } #[cfg(target_os = "windows")] -static DEFAULT_BYPASS: &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.*;"; +static DEFAULT_BYPASS: &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 = "windows")] static BYPASS_SEPARATOR: &str = ";"; #[cfg(target_os = "linux")] diff --git a/src/components/setting/mods/sysproxy-viewer.tsx b/src/components/setting/mods/sysproxy-viewer.tsx index e96a96bc4..a4080b774 100644 --- a/src/components/setting/mods/sysproxy-viewer.tsx +++ b/src/components/setting/mods/sysproxy-viewer.tsx @@ -138,7 +138,7 @@ export const SysproxyViewer = forwardRef((props, ref) => { const defaultBypass = () => { if (isWindows) { - return '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.*;' + return '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;' } if (systemName === 'linux') { return 'localhost,127.0.0.1,192.168.0.0/16,10.0.0.0/8,172.16.0.0/12,::1'