pub struct Tunnel<C> { /* private fields */ }
client
and client-legacy
only.Expand description
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§
Source§impl<C> Tunnel<C>
impl<C> Tunnel<C>
Sourcepub fn new(proxy_dst: Uri, connector: C) -> Self
pub 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.
Sourcepub fn with_auth(self, auth: HeaderValue) -> Self
pub fn with_auth(self, auth: HeaderValue) -> Self
Add proxy-authorization
header value to the CONNECT request.
Sourcepub fn with_headers(self, headers: HeaderMap) -> Self
pub fn with_headers(self, headers: HeaderMap) -> Self
Add extra headers to be sent with the CONNECT request.
If existing headers have been set, these will be merged.
Trait Implementations§
Source§impl<C> Service<Uri> for Tunnel<C>
impl<C> Service<Uri> for Tunnel<C>
Auto Trait Implementations§
impl<C> !Freeze for Tunnel<C>
impl<C> RefUnwindSafe for Tunnel<C>where
C: RefUnwindSafe,
impl<C> Send for Tunnel<C>where
C: Send,
impl<C> Sync for Tunnel<C>where
C: Sync,
impl<C> Unpin for Tunnel<C>where
C: Unpin,
impl<C> UnwindSafe for Tunnel<C>where
C: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.