pub enum ProxyMode {
Automatic,
Direct,
Explicit(String),
}proxy only.Expand description
How an HTTP client selects its proxy endpoint.
With system-proxy, resolve once with OriginProxy::resolve before building
an origin-scoped client. This type itself needs only alloc.
Variants§
Automatic
Read environment and native static settings. Per-scheme environment
endpoints override native settings, followed by ALL_PROXY. This is the
default. See OriginProxy for discovery and bypass semantics.
Direct
Connect directly, without reading proxy environment or native settings.
Ignores ProxyOptions::no_proxy.
Explicit(String)
Use this endpoint instead of environment or native proxy endpoints.
Accepts http://, https://, socks4://, socks4a://, socks5://, and
socks5h:// URLs, or a bare host[:port] for HTTP. Ports default to 80,
443, or 1080 respectively. IPv6 addresses require brackets. URL userinfo
supports existing HTTP Basic/SOCKS5 authentication; percent-encode
reserved characters. Debug output omits the URL, including credentials.
Invalid endpoints return Error::InvalidProxyUrl at construction,
even when a bypass rule matches. Paths other than /, queries, fragments,
whitespace, and port zero are rejected. SOCKS hostnames must be ASCII or
punycode. A failed connection never falls back to another proxy or direct
access. This explicit choice also applies when REQUEST_METHOD is set.
Trait Implementations§
impl Eq for ProxyMode
impl StructuralPartialEq for ProxyMode
Auto Trait Implementations§
impl Freeze for ProxyMode
impl RefUnwindSafe for ProxyMode
impl Send for ProxyMode
impl Sync for ProxyMode
impl Unpin for ProxyMode
impl UnsafeUnpin for ProxyMode
impl UnwindSafe for ProxyMode
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.