add a Proxy type
Proxies can currently be configured to intercept HTTP, HTTPS, and all requests. HTTPS tunneling is supported. Closes #30
This commit is contained in:
@@ -7,7 +7,7 @@ use futures::sync::{mpsc, oneshot};
|
||||
|
||||
use request::{self, Request, RequestBuilder};
|
||||
use response::{self, Response};
|
||||
use {async_impl, Certificate, Method, IntoUrl, RedirectPolicy, wait};
|
||||
use {async_impl, Certificate, Method, IntoUrl, Proxy, RedirectPolicy, wait};
|
||||
|
||||
/// A `Client` to make Requests with.
|
||||
///
|
||||
@@ -141,6 +141,13 @@ impl ClientBuilder {
|
||||
self
|
||||
}
|
||||
|
||||
/// Add a `Proxy` to the list of proxies the `Client` will use.
|
||||
#[inline]
|
||||
pub fn proxy(&mut self, proxy: Proxy) -> &mut ClientBuilder {
|
||||
self.inner.proxy(proxy);
|
||||
self
|
||||
}
|
||||
|
||||
/// Set a `RedirectPolicy` for this client.
|
||||
///
|
||||
/// Default will follow redirects up to a maximum of 10.
|
||||
|
||||
Reference in New Issue
Block a user