pub struct Proxy { /* private fields */ }Expand description
Proxy configuration. Only HTTP CONNECT proxies are supported (no SOCKS or HTTPS).
When credentials are provided, the Basic authentication type is used for Proxy-Authorization.
Implementations§
Source§impl Proxy
impl Proxy
Sourcepub fn new_http<S: AsRef<str>>(proxy: S) -> Result<Self, Error>
pub fn new_http<S: AsRef<str>>(proxy: S) -> Result<Self, Error>
Creates a new Proxy configuration for an HTTP proxy supporting the CONNECT command.
Supported proxy format is:
[http://][user[:password]@]host[:port]The default port is 8080.
§Example
let proxy = bitreq::Proxy::new_http("user:password@localhost:1080").unwrap();
let request = bitreq::post("http://example.com").with_proxy(proxy);Trait Implementations§
impl Eq for Proxy
impl StructuralPartialEq for Proxy
Auto Trait Implementations§
impl Freeze for Proxy
impl RefUnwindSafe for Proxy
impl Send for Proxy
impl Sync for Proxy
impl Unpin for Proxy
impl UnsafeUnpin for Proxy
impl UnwindSafe for Proxy
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