From a120c8cf988d4e9c8a90966eadc5fb7d67034e6e Mon Sep 17 00:00:00 2001
From: GyDi <segydi@foxmail.com>
Date: Fri, 2 Sep 2022 00:24:19 +0800
Subject: [PATCH] fix: external controller allow lan

---
 src-tauri/src/core/clash.rs | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src-tauri/src/core/clash.rs b/src-tauri/src/core/clash.rs
index f64951f..b3a09dc 100644
--- a/src-tauri/src/core/clash.rs
+++ b/src-tauri/src/core/clash.rs
@@ -68,6 +68,10 @@ impl ClashInfo {
         Some(val_str) => {
           if val_str.starts_with(":") {
             Some(format!("127.0.0.1{val_str}"))
+          } else if val_str.starts_with("0.0.0.0:") {
+            Some(format!("127.0.0.1:{}", &val_str[8..]))
+          } else if val_str.starts_with("[::]:") {
+            Some(format!("127.0.0.1:{}", &val_str[5..]))
           } else {
             Some(val_str.into())
           }
-- 
GitLab