18 releases

0.9.1 Mar 8, 2024
0.8.0 Apr 16, 2023
0.7.0 Sep 22, 2022
0.6.0 Jan 1, 2021
0.1.4 Dec 22, 2018

#790 in Network programming

Download history 5430/week @ 2024-07-21 5821/week @ 2024-07-28 6500/week @ 2024-08-04 5512/week @ 2024-08-11 5938/week @ 2024-08-18 5824/week @ 2024-08-25 5166/week @ 2024-09-01 4741/week @ 2024-09-08 5032/week @ 2024-09-15 4625/week @ 2024-09-22 5673/week @ 2024-09-29 6382/week @ 2024-10-06 6013/week @ 2024-10-13 4970/week @ 2024-10-20 5907/week @ 2024-10-27 5946/week @ 2024-11-03

23,122 downloads per month
Used in 12 crates (7 directly)

Apache-2.0 OR MIT

13KB
236 lines

hyper-socks2

Build Status License crates.io API docs Codecov

A SOCKS5 connector for hyper library

Changelog

License

hyper-socks2 under either of:

at your option.


lib.rs:

A SOCKS5 connector for hyper library

Example

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);

Features

  • tls feature is enabled by default. It adds TLS support using hyper-tls.
  • rustls feature adds TLS support using hyper-rustls.

Dependencies

~5–16MB
~239K SLoC