Selaa lähdekoodia

chore: change default port to 7897

MystiPanda 1 vuosi sitten
vanhempi
commit
a82929996b

+ 11 - 11
src-tauri/src/config/clash.rs

@@ -24,11 +24,11 @@ impl IClashTemp {
     pub fn template() -> Self {
         let mut map = Mapping::new();
 
-        map.insert("mixed-port".into(), 7890.into());
+        map.insert("mixed-port".into(), 7897.into());
         map.insert("log-level".into(), "info".into());
         map.insert("allow-lan".into(), false.into());
         map.insert("mode".into(), "rule".into());
-        map.insert("external-controller".into(), "127.0.0.1:9090".into());
+        map.insert("external-controller".into(), "127.0.0.1:9097".into());
         map.insert("secret".into(), "".into());
 
         Self(map)
@@ -84,9 +84,9 @@ impl IClashTemp {
                 Value::Number(val_num) => val_num.as_u64().map(|u| u as u16),
                 _ => None,
             })
-            .unwrap_or(7890);
+            .unwrap_or(7897);
         if port == 0 {
-            port = 7890;
+            port = 7897;
         }
         port
     }
@@ -109,7 +109,7 @@ impl IClashTemp {
                 }
                 None => None,
             })
-            .unwrap_or("127.0.0.1:9090".into())
+            .unwrap_or("127.0.0.1:9097".into())
     }
 
     pub fn guard_client_ctrl(config: &Mapping) -> String {
@@ -121,7 +121,7 @@ impl IClashTemp {
                 }
                 socket.to_string()
             }
-            Err(_) => "127.0.0.1:9090".into(),
+            Err(_) => "127.0.0.1:9097".into(),
         }
     }
 }
@@ -156,12 +156,12 @@ fn test_clash_info() {
 
     assert_eq!(
         IClashTemp(IClashTemp::guard(Mapping::new())).get_client_info(),
-        get_result(7890, "127.0.0.1:9090")
+        get_result(7897, "127.0.0.1:9097")
     );
 
-    assert_eq!(get_case("", ""), get_result(7890, "127.0.0.1:9090"));
+    assert_eq!(get_case("", ""), get_result(7897, "127.0.0.1:9097"));
 
-    assert_eq!(get_case(65537, ""), get_result(1, "127.0.0.1:9090"));
+    assert_eq!(get_case(65537, ""), get_result(1, "127.0.0.1:9097"));
 
     assert_eq!(
         get_case(8888, "127.0.0.1:8888"),
@@ -170,7 +170,7 @@ fn test_clash_info() {
 
     assert_eq!(
         get_case(8888, "   :98888 "),
-        get_result(8888, "127.0.0.1:9090")
+        get_result(8888, "127.0.0.1:9097")
     );
 
     assert_eq!(
@@ -195,7 +195,7 @@ fn test_clash_info() {
 
     assert_eq!(
         get_case(8888, "192.168.1.1:80800"),
-        get_result(8888, "127.0.0.1:9090")
+        get_result(8888, "127.0.0.1:9097")
     );
 }
 

+ 1 - 1
src-tauri/src/config/verge.rs

@@ -140,7 +140,7 @@ impl IVerge {
             enable_silent_start: Some(false),
             enable_system_proxy: Some(false),
             enable_random_port: Some(false),
-            verge_mixed_port: Some(7890),
+            verge_mixed_port: Some(7897),
             enable_proxy_guard: Some(false),
             proxy_guard_duration: Some(30),
             auto_close_connection: Some(true),

+ 1 - 1
src-tauri/src/feat.rs

@@ -338,7 +338,7 @@ async fn update_core_config() -> Result<()> {
 
 /// copy env variable
 pub fn copy_clash_env(app_handle: &AppHandle, option: &str) {
-    let port = { Config::verge().latest().verge_mixed_port.unwrap_or(7890) };
+    let port = { Config::verge().latest().verge_mixed_port.unwrap_or(7897) };
     let http_proxy = format!("http://127.0.0.1:{}", port);
     let socks5_proxy = format!("socks5://127.0.0.1:{}", port);
 

+ 1 - 1
src/components/setting/mods/clash-port-viewer.tsx

@@ -14,7 +14,7 @@ export const ClashPortViewer = forwardRef<DialogRef>((props, ref) => {
 
   const [open, setOpen] = useState(false);
   const [port, setPort] = useState(
-    verge?.verge_mixed_port ?? clashInfo?.port ?? 7890
+    verge?.verge_mixed_port ?? clashInfo?.port ?? 7897
   );
 
   useImperativeHandle(ref, () => ({

+ 1 - 1
src/components/setting/mods/web-ui-viewer.tsx

@@ -59,7 +59,7 @@ export const WebUIViewer = forwardRef<DialogRef>((props, ref) => {
           .slice(clashInfo.server.indexOf(":") + 1)
           .trim();
 
-        url = url.replaceAll("%port", port || "9090");
+        url = url.replaceAll("%port", port || "9097");
         url = url.replaceAll(
           "%secret",
           encodeURIComponent(clashInfo.secret || "")

+ 1 - 1
src/components/setting/setting-clash.tsx

@@ -135,7 +135,7 @@ const SettingClash = ({ onError }: Props) => {
           disabled={enable_random_port}
           autoComplete="off"
           size="small"
-          value={verge_mixed_port ?? 7890}
+          value={verge_mixed_port ?? 7897}
           sx={{ width: 100, input: { py: "7.5px", cursor: "pointer" } }}
           onClick={(e) => {
             portRef.current?.open();