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

#8 in #hyper-client

Download history 4866/week @ 2024-03-14 4955/week @ 2024-03-21 5133/week @ 2024-03-28 5624/week @ 2024-04-04 2361/week @ 2024-04-11 1893/week @ 2024-04-18 2522/week @ 2024-04-25 5491/week @ 2024-05-02 5037/week @ 2024-05-09 4581/week @ 2024-05-16 5764/week @ 2024-05-23 5715/week @ 2024-05-30 5570/week @ 2024-06-06 5808/week @ 2024-06-13 5295/week @ 2024-06-20 2223/week @ 2024-06-27

19,822 downloads per month
Used in 10 crates (6 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–20MB
~249K SLoC