pub struct ChainExecutor { /* private fields */ }Expand description
Executor for proxy chains.
Establishes a connection through a series of proxy hops, performing the appropriate protocol handshake at each step.
§Chain Execution Flow
Transport to hop 1
→ TLS wrap (if hop.tls)
→ protocol handshake requesting hop 2
→ TLS wrap (if hop.tls)
→ protocol handshake requesting hop 3
→ final protocol handshake requesting destinationImplementations§
Source§impl ChainExecutor
impl ChainExecutor
Sourcepub fn new(handlers: Vec<Box<dyn HopHandler>>) -> Self
pub fn new(handlers: Vec<Box<dyn HopHandler>>) -> Self
Creates a new ChainExecutor with the given protocol handlers.
Sourcepub fn with_tls_wrapper(self, wrapper: TlsWrapper) -> Self
pub fn with_tls_wrapper(self, wrapper: TlsWrapper) -> Self
Set a TLS wrapper for upstream hops with tls: true.
Set a shared TLS client config for protocols that need their own TLS handshake (e.g., Trojan).
Set an insecure shared TLS client config used when a hop has
insecure = true (?insecure in the URI).
Get the shared TLS client config, if set.
Get the insecure shared TLS config (if any).
Sourcepub async fn execute(
&self,
chain: &[ProxyHopSpec],
target: &TargetAddr,
) -> Result<BoxStream, ChainError>
pub async fn execute( &self, chain: &[ProxyHopSpec], target: &TargetAddr, ) -> Result<BoxStream, ChainError>
Auto Trait Implementations§
impl !RefUnwindSafe for ChainExecutor
impl !UnwindSafe for ChainExecutor
impl Freeze for ChainExecutor
impl Send for ChainExecutor
impl Sync for ChainExecutor
impl Unpin for ChainExecutor
impl UnsafeUnpin for ChainExecutor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more