add some traces for proxy
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user