Skip to content

Commit

Permalink
fix check proxy connect
Browse files Browse the repository at this point in the history
  • Loading branch information
doroved committed Oct 10, 2024
1 parent f052208 commit 84cea90
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -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."
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit 84cea90

Please sign in to comment.