add some traces for proxy

This commit is contained in:
Sean McArthur
2017-08-17 10:01:18 -07:00
parent 7bfa7adb49
commit 8719b3d540
2 changed files with 3 additions and 1 deletions

View File

@@ -136,7 +136,7 @@ pub fn new(mut res: ::hyper::client::Response, url: Url, _gzip: bool) -> Respons
let status = res.status();
let headers = mem::replace(res.headers_mut(), Headers::new());
let body = res.body();
info!("Response: '{}' for {}", status, url);
debug!("Response: '{}' for {}", status, url);
Response {
status: status,
headers: headers,

View File

@@ -48,11 +48,13 @@ impl Service for Connector {
fn call(&self, uri: Uri) -> Self::Future {
for prox in self.proxies.iter() {
if let Some(puri) = proxy::intercept(prox, &uri) {
trace!("proxy({:?}) intercepts {:?}", puri, uri);
if uri.scheme() == Some("https") {
let host = uri.host().unwrap().to_owned();
let port = uri.port().unwrap_or(443);
let tls = self.tls.clone();
return Box::new(self.https.call(puri).and_then(move |conn| {
trace!("tunneling HTTPS over proxy");
tunnel(conn, host.clone(), port)
.and_then(move |tunneled| {
tls.connect_async(&host, tunneled)