pub struct ProxyUrl {
pub protocol: ProxyProtocol,
pub host: String,
pub port: u16,
pub username: Option<String>,
pub password: Option<String>,
}Expand description
A parsed proxy URL (for example, socks5://user:pass@host:port).
Fields§
§protocol: ProxyProtocol§host: String§port: u16§username: Option<String>§password: Option<String>Implementations§
Source§impl ProxyUrl
impl ProxyUrl
Sourcepub fn parse(url: &str) -> Result<Self, String>
pub fn parse(url: &str) -> Result<Self, String>
Parse a proxy URL and percent-decode its username and password.
Supported forms are socks5://[username:password@]host[:port],
socks4://[username@]host[:port], http://[username:password@]host[:port],
and https://[username:password@]host[:port]. Schemes are matched
case-insensitively. Any path, query, or fragment is ignored because
proxy routing uses only the authority.
Source§impl ProxyUrl
impl ProxyUrl
Sourcepub fn create_connector(&self) -> SocksConnectorEnum
pub fn create_connector(&self) -> SocksConnectorEnum
Create the matching connector for SOCKS URLs.
Panics when called for an HTTP or HTTPS proxy URL.
Trait Implementations§
Auto Trait Implementations§
impl Forget for ProxyUrl
impl Freeze for ProxyUrl
impl Move for ProxyUrl
impl RefUnwindSafe for ProxyUrl
impl Send for ProxyUrl
impl Sync for ProxyUrl
impl Unpin for ProxyUrl
impl UnsafeUnpin for ProxyUrl
impl UnwindSafe for ProxyUrl
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