fix
This commit is contained in:
parent
68b32d7bdd
commit
2ab52288fd
8 changed files with 8 additions and 20 deletions
|
|
@ -1,7 +1,6 @@
|
|||
listen_port = 8080
|
||||
# listen_port_tls = 8443
|
||||
listen_ipv6 = false
|
||||
listen_only_ipv6 = false
|
||||
|
||||
max_concurrent_streams = 128
|
||||
max_clients = 512
|
||||
|
|
@ -21,4 +20,4 @@ reverse_proxy = [
|
|||
|
||||
|
||||
[experimental]
|
||||
h3 = true
|
||||
h3 = false
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ max_clients = 512
|
|||
|
||||
# Optional: Listen [::]
|
||||
listen_ipv6 = false
|
||||
listen_only_ipv6 = false
|
||||
|
||||
# Optional: App that serves all plaintext http request by referring to HOSTS or request header
|
||||
# execpt for configured application.
|
||||
|
|
@ -45,7 +44,7 @@ reverse_proxy = [
|
|||
] },
|
||||
]
|
||||
# Optional: TLS setting. if https_port is specified and tls is true above, this must be given.
|
||||
tls = { https_redirection = true, tls_cert_path = '/tmp/localhost.pem', tls_cert_key_path = '/tmp/localhost.pem' }
|
||||
tls = { https_redirection = true, tls_cert_path = 'localhost.pem', tls_cert_key_path = 'localhost.pem' }
|
||||
|
||||
|
||||
## List of destinations to send data to.
|
||||
|
|
|
|||
|
|
@ -12,5 +12,5 @@ services:
|
|||
tty: false
|
||||
privileged: true
|
||||
volumes:
|
||||
- ./localhost.pem:/tmp/localhost.pem:ro
|
||||
- ./example-certs:/tmp/certs:ro
|
||||
- ./config-example.toml:/etc/rpxy.toml:ro
|
||||
|
|
|
|||
|
|
@ -39,20 +39,11 @@ pub fn parse_opts(globals: &mut Globals, backends: &mut Backends) -> Result<()>
|
|||
},
|
||||
anyhow!("Wrong port spec.")
|
||||
);
|
||||
let mut listen_addresses: Vec<&str> = Vec::new();
|
||||
if let Some(v) = config.listen_only_ipv6 {
|
||||
if v {
|
||||
listen_addresses.extend(LISTEN_ADDRESSES_V6.iter());
|
||||
} else {
|
||||
listen_addresses.extend(LISTEN_ADDRESSES_V4.iter());
|
||||
}
|
||||
} else if let Some(v) = config.listen_ipv6 {
|
||||
listen_addresses.extend(LISTEN_ADDRESSES_V4.iter());
|
||||
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());
|
||||
}
|
||||
} else {
|
||||
listen_addresses.extend(LISTEN_ADDRESSES_V4.iter());
|
||||
}
|
||||
globals.listen_sockets = listen_addresses
|
||||
.iter()
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ pub struct ConfigToml {
|
|||
pub listen_port: Option<u16>,
|
||||
pub listen_port_tls: Option<u16>,
|
||||
pub listen_ipv6: Option<bool>,
|
||||
pub listen_only_ipv6: Option<bool>,
|
||||
pub max_concurrent_streams: Option<u32>,
|
||||
pub max_clients: Option<u32>,
|
||||
pub apps: Option<Apps>,
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ fn main() {
|
|||
apps: HashMap::<String, Backend>::default(),
|
||||
};
|
||||
|
||||
let _ = parse_opts(&mut globals, &mut backends).expect("Invalid configuration");
|
||||
parse_opts(&mut globals, &mut backends).expect("Invalid configuration");
|
||||
|
||||
entrypoint(Arc::new(globals), Arc::new(backends))
|
||||
.await
|
||||
|
|
|
|||
|
|
@ -249,7 +249,7 @@ fn remove_connection_header(headers: &mut HeaderMap) {
|
|||
}
|
||||
|
||||
fn remove_hop_header(headers: &mut HeaderMap) {
|
||||
let _ = HOP_HEADERS.iter().for_each(|key| {
|
||||
HOP_HEADERS.iter().for_each(|key| {
|
||||
headers.remove(*key);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ where
|
|||
for (server_name, backend) in self.backends.apps.iter() {
|
||||
if backend.tls_cert_key_path.is_some() && backend.tls_cert_path.is_some() {
|
||||
if let Err(_e) = backend.update_server_config().await {
|
||||
warn!("Failed to update certs for {}", server_name);
|
||||
warn!("Failed to update certs for {}: {}", server_name, _e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue