pub struct ProxyConfig {
pub host: String,
pub port: u16,
pub username: Option<String>,
pub password: Option<String>,
pub scheme: Option<String>,
}Expand description
Proxy configuration
Fields§
§host: StringProxy host
port: u16Proxy port
username: Option<String>Optional username for authentication
password: Option<String>Optional password for authentication
scheme: Option<String>Optional URL scheme. Defaults to “http” for backward compatibility.
Chrome’s --proxy-server natively supports http, https,
socks4, socks5. Use socks5h for remote DNS resolution.
Set via ProxyConfig::with_scheme.
Implementations§
Source§impl ProxyConfig
impl ProxyConfig
Sourcepub fn with_auth(
self,
username: impl Into<String>,
password: impl Into<String>,
) -> Self
pub fn with_auth( self, username: impl Into<String>, password: impl Into<String>, ) -> Self
Add authentication credentials
Sourcepub fn with_scheme(self, scheme: impl Into<String>) -> Self
pub fn with_scheme(self, scheme: impl Into<String>) -> Self
Override the URL scheme. Default is “http”. Common values:
- “http” — HTTP CONNECT (default; Chrome’s classic proxy mode)
- “https” — HTTPS CONNECT
- “socks5” — SOCKS5 with local DNS
- “socks5h” — SOCKS5 with remote (proxy-side) DNS
- “socks4” — SOCKS4
Trait Implementations§
Source§impl Clone for ProxyConfig
impl Clone for ProxyConfig
Source§fn clone(&self) -> ProxyConfig
fn clone(&self) -> ProxyConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProxyConfig
impl Debug for ProxyConfig
Source§impl<'de> Deserialize<'de> for ProxyConfig
impl<'de> Deserialize<'de> for ProxyConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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