From e53664d25aa568e6d6d62f1b62f1ca8eaa8612c4 Mon Sep 17 00:00:00 2001 From: PinkD <443657547@qq.com> Date: Sun, 13 Oct 2024 16:53:23 +0800 Subject: [PATCH] fix high cpu usage & version 5.1 --- Cargo.lock | 2 +- Cargo.toml | 2 +- README.md | 8 +++++++- libwg/wireguard-go | 2 +- pack/PKGBUILD | 2 +- src/main.rs | 2 ++ 6 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b3896a4..8359212 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -262,7 +262,7 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "corplink-rs" -version = "0.5.0" +version = "0.5.1" dependencies = [ "base32", "base64", diff --git a/Cargo.toml b/Cargo.toml index 1cb4d71..106452f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "corplink-rs" -version = "0.5.0" +version = "0.5.1" edition = "2021" [dependencies] diff --git a/README.md b/README.md index 51e41ea..ae4f553 100644 --- a/README.md +++ b/README.md @@ -114,7 +114,10 @@ macos 要求 tun 设备的名称满足正则表达式 `utun[0-9]*` ,因此需 // latency/default // latency: choose the server with the lowest latency // default: choose the first available server - "vpn_select_strategy": "latency" + "vpn_select_strategy": "latency", + // use vpn dns for macos + // NOTE: if process doesn't exit gracefully, your dns may not be restored + "use_vpn_dns": false } ``` @@ -189,6 +192,9 @@ graph TD; # Changelog +- 0.5.1 + - support using dns from server for macos(@fanwenlin) + - fix high cpu usage - 0.5.0 - add tcp support for wg-go - 0.4.4 diff --git a/libwg/wireguard-go b/libwg/wireguard-go index a121834..04970a9 160000 --- a/libwg/wireguard-go +++ b/libwg/wireguard-go @@ -1 +1 @@ -Subproject commit a121834d4b85acd6ecd799854bc678ec4162e02c +Subproject commit 04970a989de6e611b8f1e85e6316a94c3290aeea diff --git a/pack/PKGBUILD b/pack/PKGBUILD index a3db6e2..20e4253 100644 --- a/pack/PKGBUILD +++ b/pack/PKGBUILD @@ -2,7 +2,7 @@ pkgname=corplink-rs _pkgbase=corplink-rs -pkgver=5.0 +pkgver=5.1 pkgrel=1 pkgdesc='Corplink client written in Rust' arch=('i686' 'x86_64') diff --git a/src/main.rs b/src/main.rs index 59e6be0..36a7e67 100644 --- a/src/main.rs +++ b/src/main.rs @@ -70,6 +70,8 @@ async fn main() { let conf_file = parse_arg(); let mut conf = Config::from_file(&conf_file).await; let name = conf.interface_name.clone().unwrap(); + + #[cfg(target_os = "macos")] let use_vpn_dns = conf.use_vpn_dns.unwrap_or(false); match conf.server {