feat(client): proper proxy and tunneling in Client

Closes #774
This commit is contained in:
Sean McArthur
2016-04-27 11:20:07 -07:00
parent 3a3e08687b
commit f36c6b255f
10 changed files with 406 additions and 64 deletions

View File

@@ -12,7 +12,7 @@ use solicit::http::frame::{SettingsFrame, Frame};
use solicit::http::connection::{HttpConnection, EndStream, DataChunk};
use header::Headers;
use net::{NetworkStream, NetworkConnector};
use net::{NetworkStream, NetworkConnector, SslClient};
#[derive(Clone, Debug)]
pub struct MockStream {
@@ -315,3 +315,13 @@ impl NetworkConnector for MockHttp2Connector {
Ok(self.streams.borrow_mut().remove(0))
}
}
#[derive(Debug, Default)]
pub struct MockSsl;
impl<T: NetworkStream + Send + Clone> SslClient<T> for MockSsl {
type Stream = T;
fn wrap_client(&self, stream: T, _host: &str) -> ::Result<T> {
Ok(stream)
}
}