Expand description
A simple reverse-proxy implementation for onion services.
Re-exportsยง
use futures::io::BufReader;๐use futures::AsyncRead;๐use futures::AsyncWrite;๐use futures::Future;๐use futures::FutureExt as _;๐use futures::Stream;๐use futures::StreamExt as _;๐use futures::select_biased;๐use itertools::iproduct;๐use oneshot_fused_workaround as oneshot;๐use safelog::sensitive as sv;๐use std::collections::HashMap;๐use std::io::Error as IoError;๐use std::sync::Arc;๐use std::sync::Mutex;๐use strum::IntoEnumIterator;๐use tor_cell::relaycell::msg as relaymsg;๐use tor_error::ErrorKind;๐use tor_error::HasKind;๐use tor_error::debug_report;๐use tor_hsservice::HsNickname;๐use tor_hsservice::RendRequest;๐use tor_hsservice::StreamRequest;๐use tor_log_ratelim::log_ratelim;๐use tor_proto::client::stream::DataStream;๐use tor_proto::stream::IncomingStreamRequest;๐use tor_rtcompat::Runtime;๐use tor_rtcompat::SpawnExt as _;๐use crate::config::Encapsulation;๐use crate::config::ProxyAction;๐use crate::config::ProxyActionDiscriminants;๐use crate::config::ProxyConfig;๐use crate::config::TargetAddr;๐
Structsยง
- Onion
Service Reverse Proxy - A reverse proxy that handles connections from an
OnionServiceby routing them to local addresses. - State ๐
- Mutable part of an RProxy
Enumsยง
- Handle
Requests Error - An error that prevents further progress while processing requests.
- Request
Failed ๐ - An error from a single attempt to handle an onion service request.
Constantsยง
- STREAM_
BUF_ ๐LEN - Size of buffer to use for communication between Arti and the target service.
Functionsยง
- forward_
connection ๐ - Try to open a connection to an appropriate local target using
target_stream_future. If successful, try to report success onrequestand transmit data between the two stream indefinitely. On failure, closerequest. - run_
action ๐ - Take the configured action from
actionon the incoming requestrequest.