Expand description
§proxifier-rs
Proxifier is high-level proxy client library. It supports HTTP/HTTPS/SOCKS4/SOCKS5 type proxies.
- Built on top of
tokioandrustls. - This is the Rust port for proxifier, intended for use with the revamped ProxyBeast software
Do not use this crate yet, version 0.2.0 will be the final build with complete API, functionality and documentation
- Final build will have Cargo Features for TLS code artifacts management
§Quick glance into the API
use proxifier_rs::{ClientConfig, RootCertStore, socks4::Socks4};
use rustls_pki_types::ServerName;
use std::sync::Arc;
use tokio::io::{AsyncReadExt, AsyncWriteExt};
#[tokio::main]
async fn main() {
let mut root_cert_store = RootCertStore::empty();
root_cert_store.extend(webpki_roots::TLS_SERVER_ROOTS.iter().cloned());
let config = Arc::new(
ClientConfig::builder()
.with_root_certificates(root_cert_store)
.with_no_client_auth(),
);
let with_sni = ServerName::try_from("api.ipify.org").unwrap();
let mut conn = Socks4::new()
.proxy("72.195.34.35:27360".parse().unwrap())
.to("172.67.74.152:443".parse().unwrap())
.connect_tls(config.clone(), with_sni)
.await
.unwrap();
conn.write(b"GET / HTTP/1.1\r\nHost: api.ipify.org:443\r\nConnection: close\r\n\r\n")
.await
.unwrap();
let mut resp = String::new();
conn.read_to_string(&mut resp).await.unwrap();
println!("out: {:?}", resp)
}
// output:
// "HTTP/1.1 200 OK\r\nDate: Wed, 20 May 2026 11:28:39 GMT\r\nContent-Type: text/plain\r\nContent-Length: 12\r\nConnection: close\r\nServer: cloudflare\r\nVary: Origin\r\ncf-cache-status: DYNAMIC\r\nCF-RAY: 9feaffc71862614d-ATL\r\n\r\n
//
// 72.195.34.35"§Credits
Re-exports§
Modules§
- auth
- Auth provides authentication for HTTP/HTTPS and SOCKS4/SOCKS5 proxies.
- errors
- http
- https
- socks4
- Socks4
- socks5
Structs§
- Client
Config - Common configuration for (typically) all connections made by a program.
- Root
Cert Store - A container for root certificates able to provide a root-of-trust for connection authentication.
Enums§
- Server
Name - Encodes ways a client can know the expected name of the server.