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<S: AsRef<str>>(proxy: S) -> Result<Self, Error>
pub fn new<S: AsRef<str>>(proxy: S) -> Result<Self, Error>
Creates a new Proxy configuration.
Supported proxy format is:
[http://][user[:password]@]host[:port]
The default port is 8080, to be changed to 1080 in minreq 3.0.
§Example
let proxy = minreq::Proxy::new("user:password@localhost:1080").unwrap();
let request = minreq::post("http://example.com").with_proxy(proxy);
Trait Implementations§
source§impl PartialEq for Proxy
impl PartialEq for Proxy
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 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