hyperium / hyper-tls

Apache License 2.0
189 stars 96 forks source link

Reuse connection option #36

Closed gx0r closed 5 years ago

gx0r commented 5 years ago

Could it be possible to reuse the TCP connection across multiple requests?

gx0r commented 5 years ago

Closing, was already possible with:

    use hyper::client::connect::HttpConnector;
    use hyper_tls::HttpsConnector;
    use native_tls::TlsConnector;

    let mut http = HttpConnector::new(4);
    http.set_nodelay(true);
    http.set_reuse_address(true);
    http.set_keepalive(Some(std::time::Duration::from_secs(120)));
    http.enforce_http(false);
    let tls = TlsConnector::builder().build()?;
    let connector = HttpsConnector::from((http, tls));