feat(client): add Proxy support

This works by configuring proxy options on a `Client`, such as
`client.set_proxy("http", "127.0.0.1", "8018")`.

Closes #531
This commit is contained in:
Sean McArthur
2016-04-25 15:37:03 -07:00
parent 5fcc04a6cd
commit 25010fc1fc
4 changed files with 112 additions and 12 deletions

View File

@@ -133,6 +133,13 @@ pub struct PooledStream<S> {
pool: Arc<Mutex<PoolImpl<S>>>,
}
impl<S: NetworkStream> PooledStream<S> {
/// Take the wrapped stream out of the pool completely.
pub fn into_inner(mut self) -> S {
self.inner.take().expect("PooledStream lost its inner stream").stream
}
}
#[derive(Debug)]
struct PooledStreamInner<S> {
key: Key,