15 releases

0.7.0 Sep 22, 2022
0.6.0 Jan 1, 2021
0.5.0 Oct 25, 2020
0.4.3 May 12, 2020
0.1.4 Dec 22, 2018

#280 in Network programming

Download history 4222/week @ 2022-11-28 4688/week @ 2022-12-05 4490/week @ 2022-12-12 9069/week @ 2022-12-19 2962/week @ 2022-12-26 3436/week @ 2023-01-02 6502/week @ 2023-01-09 5695/week @ 2023-01-16 4219/week @ 2023-01-23 7159/week @ 2023-01-30 7709/week @ 2023-02-06 4338/week @ 2023-02-13 7140/week @ 2023-02-20 8859/week @ 2023-02-27 21734/week @ 2023-03-06 3212/week @ 2023-03-13

41,308 downloads per month
Used in 3 crates

Apache-2.0 OR MIT

12KB
225 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 std::error::Error;
# fn hidden() -> Result<(), Box<dyn Error>> {
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);

# Ok(())
# }

Features

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

Dependencies

~5–13MB
~247K SLoC