pub struct OutboundProxies { /* private fields */ }Expand description
The process-wide outbound proxy configuration, resolved once at startup.
Two independent proxies rather than one: an estate that proxies only its TLS
egress is ordinary, and select returning None for https because only
http_url was set is a decision an operator made, not a gap.
Implementations§
Source§impl OutboundProxies
impl OutboundProxies
Sourcepub fn from_config(cfg: &ProxyConfig) -> Result<Self>
pub fn from_config(cfg: &ProxyConfig) -> Result<Self>
Resolves [proxy], falling back to the conventional environment
variables for any key left empty.
Precedence, highest first:
| key | then | then |
|---|---|---|
proxy.http_url | $http_proxy | — |
proxy.https_url | $https_proxy | $HTTPS_PROXY |
proxy.no_proxy | $no_proxy | $NO_PROXY |
An empty string is “unset” in both sources: config cannot tell an
absent environment variable from one a ${VAR:-} shell default left
empty, and neither can a shell.
Uppercase HTTP_PROXY is deliberately not read. Under CGI a
client-supplied Proxy: request header lands in the environment as
HTTP_PROXY (httpoxy, CVE-2016-5385 and friends). This server is never
a CGI process, so the vector does not reach it — but Go’s net/http
dropped the variable for exactly this reason, matching it costs nothing,
and honouring a variable purely because everyone does is the kind of
thing that is only ever wrong. HTTPS_PROXY has no such history and is
honoured.
Every failure here is fatal: a proxy that cannot be understood must stop the process, never quietly leave egress going somewhere else.
Sourcepub fn is_configured(&self) -> bool
pub fn is_configured(&self) -> bool
Whether any proxy is configured at all.
Trait Implementations§
Source§impl Clone for OutboundProxies
impl Clone for OutboundProxies
Source§fn clone(&self) -> OutboundProxies
fn clone(&self) -> OutboundProxies
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OutboundProxies
impl Debug for OutboundProxies
Source§impl Default for OutboundProxies
impl Default for OutboundProxies
Source§fn default() -> OutboundProxies
fn default() -> OutboundProxies
Auto Trait Implementations§
impl Freeze for OutboundProxies
impl RefUnwindSafe for OutboundProxies
impl Send for OutboundProxies
impl Sync for OutboundProxies
impl Unpin for OutboundProxies
impl UnsafeUnpin for OutboundProxies
impl UnwindSafe for OutboundProxies
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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