Maintainers
Pricing
Enterprise
More
More
Documentation
Try Live
Rankings
Install
Blog
Docs7
Ask
New
Add Docs
Hyper SOCKS2
https://docs.rs/hyper_socks2/latest
Admin
A SOCKS5 connector for the hyper HTTP client library in Rust.
Tokens:
297
Snippets:
6
Trust Score:
9.1
Update:
4 months ago
Context
Chat
Benchmark
Latest
Show doc for...
Code
Info
Show Results
Tokens:
Raw
Copy
Link
Tokens:
Raw
Copy
Link
### Basic SOCKS5 Connector Setup Source: https://docs.rs/hyper_socks2/latest Demonstrates how to set up a basic SOCKS5 connector using hyper-socks2. Ensure the proxy address includes a scheme (e.g., 'socks5://'). ```rust use hyper::{Body, Uri}; use hyper::client::{Client, HttpConnector}; use hyper_socks2::SocksConnector; let mut connector = HttpConnector::new(); connector.enforce_http(false); let proxy = SocksConnector { proxy_addr: Uri::from_static("socks5://your.socks5.proxy:1080"), // scheme is required by HttpConnector auth: None, connector, }; // with TLS support let proxy = proxy.with_tls()?; let client = Client::builder().build::<_, Body>(proxy); ```