Skip to content

Commit 46cf22d

Browse files
authored
feat(server): disable HTTP/2 connection reuse (#38)
1 parent d569794 commit 46cf22d

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ clap = { version = "4", features = ["derive", "env"] }
2424
tokio = { version = "1", features = ["macros", "rt-multi-thread", "signal"] }
2525
tracing = { version = "0.1.40" }
2626
tracing-subscriber = { version = "0.3.0", features = ["env-filter"] }
27+
hyper-util = { version = "0.1.16", default-features = false }
2728
axum = { version = "0.8.1", features = ["http2"] }
2829
axum-extra = { version = "0.10.0", default-features = false, features = [
2930
"erased-json",

src/main.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@ pub struct Args {
3333
#[clap(short, long, default_value = "1024")]
3434
pub concurrent: usize,
3535

36-
/// Keep alive timeout (seconds)
37-
#[clap(short, long, default_value = "60")]
38-
pub keep_alive_timeout: u64,
39-
4036
/// TLS certificate file path
4137
#[clap(short = 'C', long)]
4238
pub tls_cert: Option<PathBuf>,

src/server/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use axum::{
1414
};
1515
use axum_extra::response::ErasedJson;
1616
use axum_server::Handle;
17+
use hyper_util::rt::TokioTimer;
1718
use tower::limit::ConcurrencyLimitLayer;
1819
use tower_http::{
1920
cors::{AllowHeaders, AllowMethods, AllowOrigin, CorsLayer},
@@ -40,7 +41,6 @@ pub async fn run(args: Args) -> Result<()> {
4041
tracing::info!("OS: {}", std::env::consts::OS);
4142
tracing::info!("Arch: {}", std::env::consts::ARCH);
4243
tracing::info!("Version: {}", env!("CARGO_PKG_VERSION"));
43-
tracing::info!("Keep alive: {}s", args.keep_alive_timeout);
4444
tracing::info!("Concurrent limit: {}", args.concurrent);
4545
tracing::info!("Bind address: {}", args.bind);
4646

@@ -91,7 +91,10 @@ pub async fn run(args: Args) -> Result<()> {
9191
server
9292
.http_builder()
9393
.http2()
94-
.keep_alive_timeout(Duration::from_secs(args.keep_alive_timeout));
94+
.timer(TokioTimer::new())
95+
.auto_date_header(true)
96+
.keep_alive_interval(Duration::from_secs(0))
97+
.keep_alive_timeout(Duration::from_secs(0));
9598

9699
server
97100
.handle(handle)

src/server/tracker/inspector/tls/enums.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@ enum_builder2! {
186186
ffdhe4096 => 258,
187187
ffdhe6144 => 259,
188188
ffdhe8192 => 260,
189-
X25519MLKEM768 => 4588,
190189
MLKEM1024 => 514,
190+
X25519MLKEM768 => 4588,
191191
CECPQ2 => 16696,
192192
X25519Kyber768Draft00 => 25497,
193193
X25519Kyber512Draft00 => 65072,

0 commit comments

Comments
 (0)