fix(macos): remove tproxy-port from config on macOS #5439, #5397, #5372

This commit is contained in:
Tunglies
2025-11-16 15:35:36 +08:00
parent 29d8df40b9
commit 1eb4a0d834
2 changed files with 9 additions and 1 deletions

View File

@@ -4,6 +4,7 @@
- Linux 无法切换 TUN 堆栈 - Linux 无法切换 TUN 堆栈
- macOS service 启动项显示名称(试验性修改) - macOS service 启动项显示名称(试验性修改)
- macOS 非预期 Tproxy 端口设置
<details> <details>
<summary><strong> ✨ 新增功能 </strong></summary> <summary><strong> ✨ 新增功能 </strong></summary>

View File

@@ -425,7 +425,7 @@ async fn merge_default_config(
} }
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]
{ {
if key.as_str() == Some("redir-port") || key.as_str() == Some("tproxy-port") { if key.as_str() == Some("redir-port") {
continue; continue;
} }
} }
@@ -443,6 +443,13 @@ async fn merge_default_config(
continue; continue;
} }
} }
#[cfg(not(target_os = "linux"))]
{
if key.as_str() == Some("tproxy-port") {
config.remove("tproxy-port");
continue;
}
}
// 处理 external-controller 键的开关逻辑 // 处理 external-controller 键的开关逻辑
if key.as_str() == Some("external-controller") { if key.as_str() == Some("external-controller") {
let enable_external_controller = Config::verge() let enable_external_controller = Config::verge()