socks5x 0.1.1

A simple, async SOCKS5 proxy library for Rust
Documentation

socks5x

Documentation crates

A simple, async SOCKS5 proxy library for Rust.

Features

  • Async client and server implementations
  • Support for IPv4, IPv6, and domain name addresses
  • Custom stream connectors for extensibility

Usage

Client

use socks5x::client::Socks5Client;
use socks5x::Socks5Address;

let client = Socks5Client::connect("127.0.0.1:1080").await?;
let stream = client
    .request_connect(Socks5Address::from("example.com"), 80)
    .await?;

Server

use socks5x::server::handle_client;
use tokio::net::TcpListener;

let listener = TcpListener::bind("127.0.0.1:1080").await?;
while let Ok((socket, _)) = listener.accept().await {
    tokio::spawn(async move {
        let _ = handle_client(socket).await;
    });
}