diff --git a/Cargo.toml b/Cargo.toml index d13fa00..71d6b70 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,6 +26,7 @@ hashlink = "0.9" httparse = "1.8" ipstack = { version = "0.0" } log = { version = "0.4", features = ["std"] } +percent-encoding = "2" socks5-impl = { version = "0.5" } thiserror = "1.0" tokio = { version = "1.36", features = ["full"] } @@ -36,7 +37,6 @@ tun2 = { version = "1.2", features = ["async"] } udp-stream = { version = "0.0", default-features = false } unicase = "2.7" url = "2.5" -url-escape = "0.1" [target.'cfg(target_os="linux")'.dependencies] serde = { version = "1", features = ["derive"] } diff --git a/src/args.rs b/src/args.rs index 63c1713..962dbcc 100644 --- a/src/args.rs +++ b/src/args.rs @@ -326,8 +326,9 @@ impl ArgProxy { let credentials = if url.username() == "" && url.password().is_none() { None } else { - let username = url_escape::decode(url.username()); - let password = url_escape::decode(url.password().unwrap_or("")); + use percent_encoding::percent_decode; + let username = percent_decode(url.username().as_bytes()).decode_utf8().unwrap(); + let password = percent_decode(url.password().unwrap_or("").as_bytes()).decode_utf8().unwrap(); Some(UserKey::new(username, password)) };