async-http-proxy 1.2.5

Lightweight asynchronous HTTP proxy client library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use async_http_proxy::http_connect_tokio_with_basic_auth;
use std::error::Error;
use tokio::net::TcpStream;
// Features "runtime-tokio" and "basic-auth" have to be activated
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
    let mut stream = TcpStream::connect("127.0.0.1:8080").await?;
    http_connect_tokio_with_basic_auth(&mut stream, "example.org", 443, "username", "password")
        .await?;
    // stream is now connect to github.com
    Ok(())
}