Struct Tunnel

struct Tunnel<C> { ... }

Tunnel Proxy via HTTP CONNECT

This is a connector that can be used by the legacy::Client. It wraps another connector, and after getting an underlying connection, it creates an HTTP CONNECT tunnel over it.

Implementations

impl<C> Tunnel<C>

fn new(proxy_dst: Uri, connector: C) -> Self

Create a new Tunnel service.

This wraps an underlying connector, and stores the address of a tunneling proxy server.

A Tunnel can then be called with any destination. The dst passed to call will not be used to create the underlying connection, but will be used in an HTTP CONNECT request sent to the proxy destination.

fn with_auth(self: Self, auth: HeaderValue) -> Self

Add proxy-authorization header value to the CONNECT request.

fn with_headers(self: Self, headers: HeaderMap) -> Self

Add extra headers to be sent with the CONNECT request.

If existing headers have been set, these will be merged.

impl<C> Freeze for Tunnel<C>

impl<C> RefUnwindSafe for Tunnel<C>

impl<C> Send for Tunnel<C>

impl<C> Service for Tunnel<C>

fn poll_ready(self: &mut Self, cx: &mut Context<'_>) -> Poll<Result<(), <Self as >::Error>>
fn call(self: &mut Self, dst: Uri) -> <Self as >::Future

impl<C> Sync for Tunnel<C>

impl<C> Unpin for Tunnel<C>

impl<C> UnsafeUnpin for Tunnel<C>

impl<C> UnwindSafe for Tunnel<C>

impl<C: $crate::fmt::Debug> Debug for Tunnel<C>

fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result

impl<T> Any for Tunnel<C>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Tunnel<C>

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Tunnel<C>

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> From for Tunnel<C>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Instrument for Tunnel<C>

impl<T> WithSubscriber for Tunnel<C>

impl<T, U> Into for Tunnel<C>

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for Tunnel<C>

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for Tunnel<C>

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>