add bench docker

This commit is contained in:
Jun Kurihara 2022-06-28 00:58:05 -04:00
commit 7172f932ca
No known key found for this signature in database
GPG key ID: 48ADFD173ED22B03
8 changed files with 78 additions and 8 deletions

View file

@ -38,8 +38,13 @@ pub fn parse_opts(globals: &mut Globals, backends: &mut HashMap<String, Backend>
},
anyhow!("Wrong port spec.")
);
globals.listen_sockets = LISTEN_ADDRESSES
.to_vec()
let mut listen_addresses: Vec<&str> = LISTEN_ADDRESSES_V4.to_vec();
if let Some(v) = config.listen_ipv6 {
if v {
listen_addresses.extend(LISTEN_ADDRESSES_V6.iter());
}
}
globals.listen_sockets = listen_addresses
.iter()
.flat_map(|x| {
let mut v: Vec<SocketAddr> = vec![];

View file

@ -6,6 +6,7 @@ use std::{collections::HashMap, fs};
pub struct ConfigToml {
pub listen_port: Option<u16>,
pub listen_port_tls: Option<u16>,
pub listen_ipv6: Option<bool>,
pub max_concurrent_streams: Option<u32>,
pub max_clients: Option<u32>,
pub apps: Option<Apps>,

View file

@ -1,4 +1,5 @@
pub const LISTEN_ADDRESSES: &[&str] = &["0.0.0.0", "[::]"];
pub const LISTEN_ADDRESSES_V4: &[&str] = &["0.0.0.0"];
pub const LISTEN_ADDRESSES_V6: &[&str] = &["[::]"];
// pub const HTTP_LISTEN_PORT: u16 = 8080;
// pub const HTTPS_LISTEN_PORT: u16 = 8443;
pub const TIMEOUT_SEC: u64 = 10;