pub struct ProxyConfig { /* private fields */ }Expand description
Explicit proxy routing. Defaults to direct connections and never reads proxy environment variables.
Implementations§
Source§impl ProxyConfig
impl ProxyConfig
Sourcepub fn direct() -> Self
pub fn direct() -> Self
Selects direct connections without consulting proxy environment variables.
Sourcepub fn http_connect(
url: &str,
auth: Option<ProxyBasicAuth>,
) -> Result<Self, NetError>
pub fn http_connect( url: &str, auth: Option<ProxyBasicAuth>, ) -> Result<Self, NetError>
Routes ws and wss targets through an HTTP CONNECT tunnel.
Accepts only http://host[:port]; credentials must be supplied separately.
A plain HTTP proxy does not encrypt Basic credentials, even for wss targets.
Sourcepub fn endpoint(&self) -> Option<&str>
pub fn endpoint(&self) -> Option<&str>
Returns the credential-free normalized HTTP proxy URL, or None for direct mode.
Sourcepub fn is_authenticated(&self) -> bool
pub fn is_authenticated(&self) -> bool
Returns whether proxy credentials are configured.
Trait Implementations§
Source§impl Clone for ProxyConfig
impl Clone for ProxyConfig
Source§impl Debug for ProxyConfig
impl Debug 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
Mutably borrows from an owned value. Read more