pub struct ProxyStreamConnector<S, C> { /* private fields */ }Available on crate features
dns and http-backend and http and std and tcp only.Expand description
Open a stream to the origin of a request through the proxy of its route: one a SOCKS5 proxy opens, or a tunnel an HTTP proxy opens with CONNECT.
Compose it with the direct stream connector in a MaybeProxiedConnector selecting by
HttpTunnelRoute: a request its HTTP proxy forwards has no tunnel to its origin, it
keeps the direct stream to the proxy.
Implementations§
Source§impl<S, C> ProxyStreamConnector<S, C>
impl<S, C> ProxyStreamConnector<S, C>
Sourcepub const fn new(socks: S, connect: C) -> Self
pub const fn new(socks: S, connect: C) -> Self
Create a new ProxyStreamConnector over the connector towards SOCKS5 proxies and
the one opening CONNECT tunnels.
Trait Implementations§
Source§impl<S, C, Input, Socks> Service<Input> for ProxyStreamConnector<S, C>where
S: ConnectorService<Input, Connection = Socks>,
C: ConnectorService<Input, Connection: Into<Upgraded>>,
Socks: Send + ExtensionsRef + 'static,
Input: ExtensionsRef + Send + 'static,
impl<S, C, Input, Socks> Service<Input> for ProxyStreamConnector<S, C>where
S: ConnectorService<Input, Connection = Socks>,
C: ConnectorService<Input, Connection: Into<Upgraded>>,
Socks: Send + ExtensionsRef + 'static,
Input: ExtensionsRef + Send + 'static,
Source§type Output = EstablishedClientConnection<ProxyStream<Socks>, Input>
type Output = EstablishedClientConnection<ProxyStream<Socks>, Input>
The type of the output returned by the service.
Source§type Error = ConnectionError
type Error = ConnectionError
The type of error returned by the service.
Source§async fn serve(&self, input: Input) -> Result<Self::Output, Self::Error>
async fn serve(&self, input: Input) -> Result<Self::Output, Self::Error>
Serve an output or an error for the given input
§fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
Box this service to allow for dynamic dispatch.
Auto Trait Implementations§
impl<S, C> Forget for ProxyStreamConnector<S, C>
impl<S, C> Freeze for ProxyStreamConnector<S, C>
impl<S, C> Move for ProxyStreamConnector<S, C>
impl<S, C> RefUnwindSafe for ProxyStreamConnector<S, C>where
S: RefUnwindSafe,
C: RefUnwindSafe,
impl<S, C> Send for ProxyStreamConnector<S, C>
impl<S, C> Sync for ProxyStreamConnector<S, C>
impl<S, C> Unpin for ProxyStreamConnector<S, C>
impl<S, C> UnsafeUnpin for ProxyStreamConnector<S, C>where
S: UnsafeUnpin,
C: UnsafeUnpin,
impl<S, C> UnwindSafe for ProxyStreamConnector<S, C>where
S: UnwindSafe,
C: UnwindSafe,
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<S, Input, Connection> ConnectorService<Input> for Swhere
S: Service<Input, Output = EstablishedClientConnection<Connection, Input>>,
<S as Service<Input>>::Error: Into<ConnectionError>,
Connection: Send + ExtensionsRef,
impl<S, Input, Connection> ConnectorService<Input> for Swhere
S: Service<Input, Output = EstablishedClientConnection<Connection, Input>>,
<S as Service<Input>>::Error: Into<ConnectionError>,
Connection: Send + ExtensionsRef,
§type Connection = Connection
type Connection = Connection
Connection returned by the
ConnectorService§fn connect(
&self,
input: Input,
) -> impl Future<Output = Result<EstablishedClientConnection<<S as ConnectorService<Input>>::Connection, Input>, ConnectionError>> + Send
fn connect( &self, input: Input, ) -> impl Future<Output = Result<EstablishedClientConnection<<S as ConnectorService<Input>>::Connection, Input>, ConnectionError>> + Send
Establish a connection, which often involves some kind of handshake,
or connection revival. Read more
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§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> ⓘ
Converts
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> ⓘ
Converts
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 more§impl<S> IntoEndpointService<(S,)> for S
impl<S> IntoEndpointService<(S,)> for S
type Service = S
§fn into_endpoint_service(self) -> <S as IntoEndpointService<(S,)>>::Service
fn into_endpoint_service(self) -> <S as IntoEndpointService<(S,)>>::Service
convert the type into a
rama_core::Service.§impl<S, State> IntoEndpointServiceWithState<(S,), State> for S
impl<S, State> IntoEndpointServiceWithState<(S,), State> for S
type Service = S
§fn into_endpoint_service_with_state(
self,
_state: State,
) -> <S as IntoEndpointServiceWithState<(S,), State>>::Service
fn into_endpoint_service_with_state( self, _state: State, ) -> <S as IntoEndpointServiceWithState<(S,), State>>::Service
convert the type into a
rama_core::Service with state.§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a rama_grpc::Request§impl<Io, S> MakeMockServer<Io, ServerClone> for S
impl<Io, S> MakeMockServer<Io, ServerClone> for S
type Server = S
fn make_server(&self, _: &ConnectRequest) -> S
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Create a new
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more