pub struct ProxyConfig {
pub mode: ProxyMode,
pub protocol: Option<String>,
pub host: Option<String>,
pub port: Option<u16>,
pub username: Option<String>,
pub password: Option<String>,
pub bypass: Vec<String>,
pub pac_url: Option<String>,
pub pac_script: Option<String>,
}Expand description
Proxy configuration.
Here rather than in tropel-http, where the bypass matching and PAC
failover live, for the same reason AuthConfig is here while the signers
are in tropel-auth: this is the DATA a request carries, and Request is
in this crate. A type in tropel-http could not be a field of Request
at all — the SDK is a leaf and depends on zero tropel-* crates.
One struct for all four modes rather than an enum with per-mode payloads:
it crosses a JSON wire (KnockPort’s settings.proxy) where an
externally-tagged enum would change shape per mode, and a UI that lets the
user switch mode must not lose the host they typed for fixed when they
look at system.
Hash because it KEYS a client map: reqwest bakes proxies in at build
time, so one lazily-built client per distinct profile is how a per-request
proxy is executed at all.
Fields§
§mode: ProxyMode§protocol: Option<String>http, https, socks5 — the proxy’s own scheme, not the target’s.
host: Option<String>§port: Option<u16>§username: Option<String>§password: Option<String>§bypass: Vec<String>Hosts that must NOT go through the proxy.
pac_url: Option<String>pac mode: where to fetch the script, or the script itself.
pac_script: Option<String>Implementations§
Trait Implementations§
Source§impl Clone for ProxyConfig
impl Clone for ProxyConfig
Source§fn clone(&self) -> ProxyConfig
fn clone(&self) -> ProxyConfig
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 ProxyConfig
impl Debug for ProxyConfig
Source§impl Default for ProxyConfig
impl Default for ProxyConfig
Source§fn default() -> ProxyConfig
fn default() -> ProxyConfig
Source§impl<'de> Deserialize<'de> for ProxyConfigwhere
ProxyConfig: Default,
impl<'de> Deserialize<'de> for ProxyConfigwhere
ProxyConfig: Default,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ProxyConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ProxyConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for ProxyConfig
Source§impl Hash for ProxyConfig
impl Hash for ProxyConfig
Source§impl PartialEq for ProxyConfig
impl PartialEq for ProxyConfig
Source§impl Serialize for ProxyConfig
impl Serialize for ProxyConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for ProxyConfig
Auto Trait Implementations§
impl Freeze for ProxyConfig
impl RefUnwindSafe for ProxyConfig
impl Send for ProxyConfig
impl Sync for ProxyConfig
impl Unpin for ProxyConfig
impl UnsafeUnpin for ProxyConfig
impl UnwindSafe for ProxyConfig
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.