1#![doc = include_str!("../README.md")]
2pub use rustls::{ClientConfig, RootCertStore};
3pub use rustls_pki_types::ServerName;
4pub type Result<T> = std::result::Result<T, errors::Error>;
5
6use std::borrow::Cow;
7fn is_ok_status(utf8_proxy_response: Cow<'_, str>) -> bool {
8 utf8_proxy_response
9 .lines()
10 .next()
11 .and_then(|line| line.split_whitespace().nth(1))
12 .and_then(|code| code.parse::<u16>().ok())
13 .map(|code| (200..399).contains(&code))
14 .unwrap_or(false)
15}
16
17pub mod auth;
18pub mod errors;
19
20pub use errors::Error;
21pub mod http;
22pub mod https;
23pub mod socks4;
24pub use socks4::Response;
25pub mod socks5;
26
27#[cfg(test)]
28mod tests;