From 84cea902df69728e2e434ffe8f3496de94525ab5 Mon Sep 17 00:00:00 2001 From: doroved Date: Thu, 10 Oct 2024 19:04:27 +0300 Subject: [PATCH] fix check proxy connect --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/lib.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a77ed1a..3a07834 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -699,7 +699,7 @@ dependencies = [ [[package]] name = "proxer" -version = "0.1.1" +version = "0.1.2" dependencies = [ "base64", "chrono", diff --git a/Cargo.toml b/Cargo.toml index 08d663b..b6cd953 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "proxer" -version = "0.1.1" +version = "0.1.2" edition = "2021" authors = ["doroved"] description = "Proxy manager all network requests on macOS + spoofDPI all direct connections." diff --git a/src/lib.rs b/src/lib.rs index 41f8ab7..e522c7d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -334,7 +334,7 @@ where let mut response = [0u8; 1024]; let n = timeout(Duration::from_secs(5), stream.read(&mut response)).await??; - if !response[..n].starts_with(b"HTTP/1.1 200") { + if !response[..n].windows(3).any(|window| window == b"200") { return Err(format!( "Proxy connection failed: {:?}", String::from_utf8_lossy(&response[..n])