wip: refactoring all the structure and improve error messages
This commit is contained in:
parent
f98c778a0c
commit
de91c7a68f
10 changed files with 268 additions and 56 deletions
22
rpxy-lib/src/proxy/mod.rs
Normal file
22
rpxy-lib/src/proxy/mod.rs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
mod proxy_main;
|
||||
mod socket;
|
||||
|
||||
use crate::{globals::Globals, hyper_executor::LocalExecutor};
|
||||
use hyper_util::server::{self, conn::auto::Builder as ConnectionBuilder};
|
||||
use std::sync::Arc;
|
||||
|
||||
pub(crate) use proxy_main::Proxy;
|
||||
|
||||
/// build connection builder shared with proxy instances
|
||||
pub(crate) fn connection_builder(globals: &Arc<Globals>) -> Arc<ConnectionBuilder<LocalExecutor>> {
|
||||
let executor = LocalExecutor::new(globals.runtime_handle.clone());
|
||||
let mut http_server = server::conn::auto::Builder::new(executor);
|
||||
http_server
|
||||
.http1()
|
||||
.keep_alive(globals.proxy_config.keepalive)
|
||||
.pipeline_flush(true);
|
||||
http_server
|
||||
.http2()
|
||||
.max_concurrent_streams(globals.proxy_config.max_concurrent_streams);
|
||||
Arc::new(http_server)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue