mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-08 02:52:07 +08:00
fix(proxy): check if proxy port is in use #5891
This commit is contained in:
@@ -554,3 +554,12 @@ export const isAdmin = async () => {
|
||||
export async function getNextUpdateTime(uid: string) {
|
||||
return invoke<number | null>("get_next_update_time", { uid });
|
||||
}
|
||||
|
||||
export const isPortInUse = async (port: number) => {
|
||||
try {
|
||||
return await invoke<boolean>("is_port_in_use", { port });
|
||||
} catch (error) {
|
||||
console.error("检查端口使用状态失败:", error);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user