Skip to content

Commit 9cb1d76

Browse files
committed
fix: trojan params parse error
1 parent d75b8ff commit 9cb1d76

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

proxrs/src/protocol/trojan.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ impl ProxyAdapter for Trojan {
5858
// allowInsecure=1#%F0%9F%87%AD%F0%9F%87%B0%E9%A6%99%E6%B8%AF%2001%20%7C%20%E4%B8%93%E7%BA%
5959
// BF%0D
6060
let mut url = &link[9..];
61-
6261
let mut name = String::from("");
6362
if let Some((v1, v2)) = url.rsplit_once("#") {
6463
url = v1;
@@ -69,7 +68,7 @@ impl ProxyAdapter for Trojan {
6968
// the-best-airport.com:443?type=tcp&sni=new.download.the-best-airport.com&allowInsecure=1
7069
// 53fa8faf-ba4b-4322-9c69-a3e5b1555049@156.238.18.163:2095/?type=ws
7170
let mut parts: Vec<&str> = url.split("/?").collect();
72-
if parts.len() == 1 {
71+
if parts.len() == 1 || parts[0].contains("?") {
7372
parts = url.split("?").collect();
7473
}
7574
let mut network = None;

0 commit comments

Comments
 (0)