pub struct ProxyHandle { /* private fields */ }Expand description
A running loopback egress proxy. Dropping the handle shuts it down.
Implementations§
Source§impl ProxyHandle
impl ProxyHandle
Sourcepub fn addr(&self) -> SocketAddr
pub fn addr(&self) -> SocketAddr
The loopback address the proxy listens on. A spawned child is wired via
Self::proxy_env; a no-subprocess caller (#257 — e.g. a
reqwest::Client) points itself here instead:
reqwest::Proxy::all(format!("http://{}", handle.addr())).
Sourcepub fn refused_hosts(&self) -> Vec<String>
pub fn refused_hosts(&self) -> Vec<String>
#196: the CONNECT hosts this proxy REFUSED (not on the allow-list),
deduplicated and sorted. The shell tool reads this after the child is
reaped and turns each into a Denial { kind: Net, target: host } so a
consumer can prompt per-host. Empty when the child only reached
allow-listed hosts (or none).
Sourcepub fn proxy_env(&self) -> Vec<(String, String)>
pub fn proxy_env(&self) -> Vec<(String, String)>
The *_PROXY environment the child needs to route through this proxy.
Both cases are set: curl honours lowercase http_proxy (it ignores the
uppercase form for CGI-safety) but uppercase HTTPS_PROXY/ALL_PROXY;
other tools (wget, requests, node) read the rest.
Trait Implementations§
Source§impl Debug for ProxyHandle
impl Debug for ProxyHandle
Source§impl Drop for ProxyHandle
impl Drop for ProxyHandle
Auto Trait Implementations§
impl !RefUnwindSafe for ProxyHandle
impl !UnwindSafe for ProxyHandle
impl Freeze for ProxyHandle
impl Send for ProxyHandle
impl Sync for ProxyHandle
impl Unpin for ProxyHandle
impl UnsafeUnpin for ProxyHandle
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<F, T> ConvertInto<T> for Fwhere
T: ConvertFrom<F>,
impl<F, T> ConvertInto<T> for Fwhere
T: ConvertFrom<F>,
Source§fn convert_into(self) -> T
fn convert_into(self) -> T
Self to a value of type T.Source§impl<F, T> ConvertTryFrom<F> for Twhere
F: ConvertInto<T>,
impl<F, T> ConvertTryFrom<F> for Twhere
F: ConvertInto<T>,
Source§impl<F, T> ConvertTryInto<T> for Fwhere
T: ConvertTryFrom<F>,
impl<F, T> ConvertTryInto<T> for Fwhere
T: ConvertTryFrom<F>,
Source§type Error = <T as ConvertTryFrom<F>>::Error
type Error = <T as ConvertTryFrom<F>>::Error
Source§fn convert_try_into(self) -> Result<T, <T as ConvertTryFrom<F>>::Error>
fn convert_try_into(self) -> Result<T, <T as ConvertTryFrom<F>>::Error>
Self to a value of type T.impl<T> ErasedDestructor for Twhere
T: 'static,
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 more