fix reverse socks5 proxy for udp association

This commit is contained in:
Σrebe - Romain GERARD 2024-01-07 17:03:42 +01:00
parent 3f9136afd2
commit ac76f52f6d
No known key found for this signature in database
GPG key ID: 7A42B4B97E0332F4

View file

@ -111,10 +111,11 @@ async fn run_tunnel(
let local_srv = (Host::parse(&jwt.claims.r)?, jwt.claims.rp);
let bind = format!("{}:{}", local_srv.0, local_srv.1);
let listening_server = socks5::run_server(bind.parse()?, None);
let (tcp, local_srv) = run_listening_server(&local_srv, SERVERS.deref(), listening_server).await?;
let (local_rx, local_tx) = tokio::io::split(tcp);
let (stream, local_srv) = run_listening_server(&local_srv, SERVERS.deref(), listening_server).await?;
let proto = stream.local_protocol();
let (local_rx, local_tx) = tokio::io::split(stream);
Ok((jwt.claims.p, local_srv.0, local_srv.1, Box::pin(local_rx), Box::pin(local_tx)))
Ok((proto, local_srv.0, local_srv.1, Box::pin(local_rx), Box::pin(local_tx)))
}
_ => Err(anyhow::anyhow!("Invalid upgrade request")),
}