Expand description
§proxifier-rs
Simple proxy client library to relay network packets towards a destination target using a proxy. With built-in support for TLS.
- Supports SOCKS4/5 and HTTP/HTTPS type proxies
This is a Rust port of proxifier. Specifically designed for production use with ProxyBeast software.
§Uses Async
- With
tokio - Tracing support todo
§Supports
- TLS via
rustls
If you want to use a different TLS library, feel free to disable this crate’s default Cargo feature: tls
§Summary of the API
Exports simple connect functions from which a TcpStream is obtained and can in turn be wrapped into a TlsStream<TcpStream> with support for TLS.
§Quick glance into the API
#[tokio::test]
async fn test_socks5_ipv4() -> std::result::Result<(), Box<dyn std::error::Error>> {
let mut conn = crate::socks5::connect(
Context {
proxy: "194.113.119.68:6742".parse()?,
destination: NetworkTarget::IP("104.26.12.205:80".parse()?),
},
Auth::UserPass("vcilvnba".into(), "vi14viqvvrr7".into()), // or Auth::NoAuth
)
.await?;
conn.write(b"GET / HTTP/1.1\r\nHost: api.ipify.org:80\r\nConnection: close\r\n\r\n")
.await?;
let mut resp = String::new();
conn.read_to_string(&mut resp).await?;
println!("out: {:?}", resp);
Ok(())
}
// running 1 test
// out: "HTTP/1.1 200 OK\r\nDate: Thu, 21 May 2026 15:15:52 GMT\r\nContent-Type: text/plain\r\nContent-Length: 14\r\nConnection: close\r\nServer: cloudflare\r\nVary: Origin\r\ncf-cache-status: DYNAMIC\r\nCF-RAY: 9ff489fdddc0dc72-FRA\r\n\r\n
//
// 194.113.119.68"
// test tests::test_socks5_ipv4 ... ok§Credits
Re-exports§
pub use errors::Error;pub use tls_exports::*;
Modules§
- auth
- Auth provides authentication for HTTP/HTTPS and SOCKS5 proxies.
- errors
- http
- https
- socks4
- Socks4
- socks5
- Socks5
- tls_
exports
Structs§
- Context
- Context contains machine level information, such as details for the proxy server and it’s destination address
- Port
- Used in conjunction with
NetworkTarget::Domainand in adjacency to SOCKS5 connect operations
Enums§
- Network
Target - Represents either IPV4 and IPV6 via
NetworkTarget::IPor domain viaNetworkTarget::Domain
Functions§
- socks_
with_ tls - Wraps the
TcpStreamso that it supports TLS