diff --git a/src/proxy/proxy_h3.rs b/src/proxy/proxy_h3.rs index 4be9b00..c56b35d 100644 --- a/src/proxy/proxy_h3.rs +++ b/src/proxy/proxy_h3.rs @@ -4,6 +4,7 @@ use bytes::{Buf, Bytes}; use h3::{quic::BidiStream, server::RequestStream}; use hyper::{client::connect::Connect, Body, HeaderMap, Request, Response}; use std::net::SocketAddr; +use tokio::time::Duration; impl Proxy where @@ -57,7 +58,7 @@ where // .await // .map_err(|e| anyhow!("HTTP/3 accept failed: {}", e))? while let Some((req, stream)) = match tokio::time::timeout( - tokio::time::Duration::from_millis(H3_CONN_TIMEOUT_MILLIS), + Duration::from_millis(H3_CONN_TIMEOUT_MILLIS), h3_conn.accept(), ) .await diff --git a/src/proxy/proxy_tls.rs b/src/proxy/proxy_tls.rs index 6951561..29d4caf 100644 --- a/src/proxy/proxy_tls.rs +++ b/src/proxy/proxy_tls.rs @@ -5,8 +5,8 @@ use futures::StreamExt; use futures::{future::FutureExt, select}; use hyper::{client::connect::Connect, server::conn::Http}; use rustls::ServerConfig; -use std::{sync::Arc, time::Duration}; -use tokio::net::TcpListener; +use std::sync::Arc; +use tokio::{net::TcpListener, time::Duration}; impl Proxy where @@ -122,7 +122,7 @@ where .get(initial_app_name) .ok_or_else(|| anyhow!(""))?; while backend_serve.get_tls_server_config().is_none() { - tokio::time::sleep(tokio::time::Duration::from_millis(10)).await; + tokio::time::sleep(Duration::from_millis(10)).await; } let server_crypto = backend_serve .get_tls_server_config()