Skip to content

Commit

Permalink
wip: fix keep alive timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
junkurihara committed Dec 11, 2023
1 parent d526ce6 commit b8f3034
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions rpxy-lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ tokio = { version = "1.34.0", default-features = false, features = [
"macros",
"fs",
] }
pin-project-lite = "0.2.13"
async-trait = "0.1.74"

# Error handling
Expand Down
2 changes: 2 additions & 0 deletions rpxy-lib/src/hyper_ext/mod.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
mod body_incoming_like;
mod body_type;
mod executor;
mod tokio_timer;
mod watch;

pub(crate) mod rt {
pub(crate) use super::executor::LocalExecutor;
pub(crate) use super::tokio_timer::{TokioSleep, TokioTimer};
}
pub(crate) mod body {
pub(crate) use super::body_incoming_like::IncomingLike;
Expand Down
7 changes: 6 additions & 1 deletion rpxy-lib/src/proxy/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ mod proxy_quic_quinn;
mod proxy_quic_s2n;
mod socket;

use crate::{globals::Globals, hyper_ext::rt::LocalExecutor};
use crate::{
globals::Globals,
hyper_ext::rt::{LocalExecutor, TokioTimer},
};
use hyper_util::server::{self, conn::auto::Builder as ConnectionBuilder};
use std::sync::Arc;

Expand All @@ -20,10 +23,12 @@ pub(crate) fn connection_builder(globals: &Arc<Globals>) -> Arc<ConnectionBuilde
.http1()
.keep_alive(globals.proxy_config.keepalive)
.header_read_timeout(globals.proxy_config.proxy_idle_timeout)
.timer(TokioTimer)
.pipeline_flush(true);
http_server
.http2()
.keep_alive_interval(Some(globals.proxy_config.proxy_idle_timeout))
.timer(TokioTimer)
.max_concurrent_streams(globals.proxy_config.max_concurrent_streams);
Arc::new(http_server)
}

0 comments on commit b8f3034

Please sign in to comment.