diff --git a/bench/rpxy.toml b/bench/rpxy.toml index d6667de..d34150a 100644 --- a/bench/rpxy.toml +++ b/bench/rpxy.toml @@ -1,6 +1,7 @@ listen_port = 8080 # listen_port_tls = 8443 listen_ipv6 = false +listen_only_ipv6 = false max_concurrent_streams = 128 max_clients = 512 @@ -17,3 +18,7 @@ reverse_proxy = [ { upstream = [{ location = 'backend-nginx', tls = false }] }, # { upstream = [{ location = '192.168.100.100', tls = false }] }, ] + + +[experimental] +h3 = true diff --git a/config-example.toml b/config-example.toml index 6792965..f9cb30b 100644 --- a/config-example.toml +++ b/config-example.toml @@ -55,3 +55,9 @@ tls = { https_redirection = true, tls_cert_path = 'localhost.pem', tls_cert_key_ [apps.another_localhost] server_name = 'localhost.localdomain' reverse_proxy = [{ upstream = [{ location = 'www.google.com', tls = true }] }] + +################################### +# Experimantal settings # +################################### +[experimental] +h3 = true diff --git a/src/config/parse.rs b/src/config/parse.rs index 56bdc8a..bb18674 100644 --- a/src/config/parse.rs +++ b/src/config/parse.rs @@ -151,6 +151,16 @@ pub fn parse_opts(globals: &mut Globals, backends: &mut Backends) -> Result<()> } } + // experimental + if let Some(exp) = config.experimental { + if let Some(b) = exp.h3 { + globals.http3 = b; + if b { + info!("Experimental HTTP/3.0 is enabled. Note it is still very unstable.") + } + } + } + Ok(()) } diff --git a/src/config/toml.rs b/src/config/toml.rs index 94eaf45..87fc8bb 100644 --- a/src/config/toml.rs +++ b/src/config/toml.rs @@ -13,6 +13,12 @@ pub struct ConfigToml { pub max_clients: Option, pub apps: Option, pub default_app: Option, + pub experimental: Option, +} + +#[derive(Deserialize, Debug, Default)] +pub struct Experimental { + pub h3: Option, } #[derive(Deserialize, Debug, Default)] diff --git a/src/globals.rs b/src/globals.rs index 30227c7..19dd539 100644 --- a/src/globals.rs +++ b/src/globals.rs @@ -16,6 +16,7 @@ pub struct Globals { pub clients_count: ClientsCount, pub max_concurrent_streams: u32, pub keepalive: bool, + pub http3: bool, pub runtime_handle: tokio::runtime::Handle, } diff --git a/src/main.rs b/src/main.rs index 5010d73..be59bfc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -55,6 +55,7 @@ fn main() { listen_sockets: Vec::new(), http_port: None, https_port: None, + http3: false, timeout: Duration::from_secs(TIMEOUT_SEC), max_clients: MAX_CLIENTS, clients_count: Default::default(),