Commit 1e1bdc04 authored by Nick Mathewson's avatar Nick Mathewson 🥔
Browse files

pt-proxy example: Upgrade to fast-socks5 v0.9.1.

parent af6db6c2
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1663,11 +1663,12 @@ checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a"

[[package]]
name = "fast-socks5"
version = "0.8.2"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "961ce1761191c157145a8c9f0c3ceabecd3a729d65c9a8d443674eaee3420f7e"
checksum = "aa6a4a9ab1f87e2d8e9345ce944de7c45d065ee89f5942512f32698e48a8429a"
dependencies = [
 "anyhow",
 "async-trait",
 "log",
 "thiserror",
 "tokio",
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ publish = false
anyhow = "1.0.72"
arti-client = { path = "../../../crates/arti-client", features = [ "bridge-client", "pt-client", "experimental" ] }
clap = { version = "4.3.21", features = [ "derive" ] }
fast-socks5 = "0.8.2"
fast-socks5 = "0.9.1"
thiserror = "1.0.44"
tokio = { version = "1.7", features = ["full"] }
tokio-stream = "0.1.14"
+2 −2
Original line number Diff line number Diff line
use anyhow::Result;
use clap::{Parser, Subcommand};
use fast_socks5::client::{Config, Socks5Stream};
use fast_socks5::server::Socks5Server;
use fast_socks5::server::{AcceptAuthentication, Socks5Server};
use std::str::FromStr;
use tokio::io::AsyncWriteExt;
use tokio::net::{TcpListener, TcpStream};
@@ -232,7 +232,7 @@ async fn run_forwarding_server(endpoint: &str, forward_creds: ForwardingCreds) -
/// Run the final hop of the connection, which finally makes the actual
/// network request to the intended host and relays it back
async fn run_socks5_server(endpoint: &str) -> Result<oneshot::Receiver<bool>> {
    let listener = Socks5Server::bind(endpoint).await?;
    let listener = Socks5Server::<AcceptAuthentication>::bind(endpoint).await?;
    let (tx, rx) = oneshot::channel::<bool>();
    tokio::spawn(async move {
        while let Some(Ok(socks_socket)) = listener.incoming().next().await {