diff options
author | Alex Auvolat <alex@adnab.me> | 2022-05-10 12:11:59 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-05-10 12:11:59 +0200 |
commit | 698236cdb4ed6e0280f87da4006bd53dce8b3dc1 (patch) | |
tree | d79f0c03e8776741ae78a44bd4398938826cba61 /src/https.rs | |
parent | cbf7a03836237d102e5b3d7f3eb93a1c6eb3ac91 (diff) | |
download | tricot-698236cdb4ed6e0280f87da4006bd53dce8b3dc1.tar.gz tricot-698236cdb4ed6e0280f87da4006bd53dce8b3dc1.zip |
Enable upgrades on http moduledocker-41
Diffstat (limited to 'src/https.rs')
-rw-r--r-- | src/https.rs | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/https.rs b/src/https.rs index 7dcf051..ba4365d 100644 --- a/src/https.rs +++ b/src/https.rs @@ -77,14 +77,17 @@ pub async fn serve_https( match tls_acceptor.accept(socket).await { Ok(stream) => { debug!("TLS handshake was successfull"); - let http_conn = Http::new().serve_connection( - stream, - service_fn(move |req: Request<Body>| { - let https_config = config.clone(); - let proxy_config: Arc<ProxyConfig> = rx_proxy_config.borrow().clone(); - handle_outer(remote_addr, req, https_config, proxy_config) - }), - ); + let http_conn = Http::new() + .serve_connection( + stream, + service_fn(move |req: Request<Body>| { + let https_config = config.clone(); + let proxy_config: Arc<ProxyConfig> = + rx_proxy_config.borrow().clone(); + handle_outer(remote_addr, req, https_config, proxy_config) + }), + ) + .with_upgrades(); let timeout = tokio::time::sleep(MAX_CONNECTION_LIFETIME); tokio::pin!(http_conn, timeout); let http_result = loop { |