Skip to main content

Module socks

Module socks 

Source
Expand description

SOCKS-specific proxy support.

Re-exportsΒ§

use futures::io::AsyncRead; πŸ”’
use futures::io::AsyncReadExt; πŸ”’
use futures::io::AsyncWrite; πŸ”’
use futures::io::BufReader; πŸ”’
use safelog::sensitive; πŸ”’
use std::net::IpAddr; πŸ”’
use std::net::Ipv4Addr; πŸ”’
use std::net::Ipv6Addr; πŸ”’
use std::sync::Arc; πŸ”’
use tracing::debug; πŸ”’
use tracing::instrument; πŸ”’
use tracing::instrument; πŸ”’
use tracing::warn; πŸ”’
use arti_client::HasKind; πŸ”’
use arti_client::ErrorKind; πŸ”’
use arti_client::IntoTorAddr as _; πŸ”’
use arti_client::StreamPrefs; πŸ”’
use tor_basic_utils::onionperf_types::OnionperfEvent; πŸ”’
use tor_basic_utils::onionperf_types::OnionperfStreamStatus; πŸ”’
use tor_rpcbase as rpc; πŸ”’
use tor_rtcompat::Runtime; πŸ”’
use tor_socksproto::Handshake as _; πŸ”’
use tor_socksproto::SocksAddr; πŸ”’
use tor_socksproto::SocksAuth; πŸ”’
use tor_socksproto::SocksCmd; πŸ”’
use tor_socksproto::SocksRequest; πŸ”’
use anyhow::Context; πŸ”’
use anyhow::Result; πŸ”’
use anyhow::anyhow; πŸ”’
use super::ListenerIsolation; πŸ”’
use super::ProvidedIsolation; πŸ”’
use super::ProxyContext; πŸ”’
use super::StreamIsolationKey; πŸ”’
use super::write_all_and_close; πŸ”’
use super::write_all_and_flush; πŸ”’
use crate::rpc::conntarget::ConnTarget; πŸ”’

StructsΒ§

AuthInterpretation πŸ”’
The meaning of a SOCKS authentication field, according to our conventions.

ConstantsΒ§

WRONG_PROTOCOL_PAYLOAD πŸ”’
Payload to return when an HTTP connection arrive on a Socks port without HTTP support.

FunctionsΒ§

handle_socks_conn πŸ”’
Given a just-received TCP connection S on a SOCKS port, handle the SOCKS handshake and relay the connection over the Tor network.
interpret_socks_auth πŸ”’
Given the authentication object from a socks connection, determine what it’s telling us to do.
reply_error πŸ”’
Reply a Socks error based on an arti-client Error and close the stream. Returns the error provided in parameter
stream_preference
Find out which kind of address family we can/should use for a given SocksRequest.