pub struct ProxyConfig { /* private fields */ }Expand description
Explicit proxy used by panel HTTP, WebSocket, and subscription requests.
Proxy URLs must not contain credentials. Add username/password separately
with ProxyConfig::with_basic_auth so ordinary URL and Debug handling
cannot expose them.
Implementations§
Source§impl ProxyConfig
impl ProxyConfig
Sourcepub fn new(url: impl AsRef<str>) -> Result<Self>
pub fn new(url: impl AsRef<str>) -> Result<Self>
Parses an HTTP, HTTPS, SOCKS5, or SOCKS5h proxy URL.
§Errors
Returns Error::Configuration for an unsupported/relative URL,
embedded credentials, or a path, query, or fragment.
Sourcepub fn with_basic_auth(
self,
username: impl Into<String>,
password: impl Into<String>,
) -> Result<Self>
pub fn with_basic_auth( self, username: impl Into<String>, password: impl Into<String>, ) -> Result<Self>
Adds HTTP Basic or SOCKS5 username/password authentication.
§Errors
Returns Error::Configuration when the username is empty/contains a
colon or SOCKS5’s one-byte username/password length limit is exceeded.
Sourcepub const fn scheme(&self) -> ProxyScheme
pub const fn scheme(&self) -> ProxyScheme
Returns the selected proxy protocol and DNS behavior.
Sourcepub const fn has_basic_auth(&self) -> bool
pub const fn has_basic_auth(&self) -> bool
Returns whether proxy authentication is configured.
Trait Implementations§
Source§impl Clone for ProxyConfig
impl Clone for ProxyConfig
Source§impl Debug for ProxyConfig
impl Debug for ProxyConfig
Source§impl FromStr for ProxyConfig
impl FromStr for ProxyConfig
Source§impl TryFrom<&str> for ProxyConfig
impl TryFrom<&str> 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
Converts
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> ⓘ
Converts
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