pub enum ProxyScheme {
Http {
is_https: bool,
basic_auth: Option<HeaderValue>,
authority: Authority,
},
Socks5 {
remote_dns: bool,
password_auth: Option<(Arc<str>, Arc<str>)>,
host: Arc<str>,
port: u16,
},
}Expand description
A particular scheme used for proxying requests.
Currently only HTTP(s) and SOCKS5 are supported.
§Examples
http://127.0.0.1:7890// if port not specified, default to 80.https://127.0.0.1:7890// if port not specified, default to 443.socks5://127.0.0.1:7890// if port not specified, default to 7890.socks5h://127.0.0.1:7890// if port not specified, default to 7890.
Variants§
Http
HTTP / HTTPS proxy
Socks5
SOCKS5 proxy
Implementations§
Source§impl ProxyScheme
impl ProxyScheme
Sourcepub const fn http_auth(&self) -> Option<&HeaderValue>
pub const fn http_auth(&self) -> Option<&HeaderValue>
For HTTP proxies, returns the optional HTTP Basic auth.
Trait Implementations§
Source§impl Clone for ProxyScheme
impl Clone for ProxyScheme
Source§fn clone(&self) -> ProxyScheme
fn clone(&self) -> ProxyScheme
Returns a copy 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 ProxyScheme
impl Debug for ProxyScheme
Source§impl<'de> Deserialize<'de> for ProxyScheme
impl<'de> Deserialize<'de> for ProxyScheme
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
Source§impl FromStr for ProxyScheme
impl FromStr for ProxyScheme
Source§impl Hash for ProxyScheme
impl Hash for ProxyScheme
Source§impl PartialEq for ProxyScheme
impl PartialEq for ProxyScheme
Source§impl Serialize for ProxyScheme
impl Serialize for ProxyScheme
impl Eq for ProxyScheme
impl StructuralPartialEq for ProxyScheme
Auto Trait Implementations§
impl !Freeze for ProxyScheme
impl RefUnwindSafe for ProxyScheme
impl Send for ProxyScheme
impl Sync for ProxyScheme
impl Unpin for ProxyScheme
impl UnwindSafe for ProxyScheme
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