refactor
This commit is contained in:
parent
58e22d33af
commit
16290f3173
3 changed files with 20 additions and 18 deletions
|
|
@ -31,24 +31,6 @@ pub fn build_settings(
|
||||||
///////////////////////////////////
|
///////////////////////////////////
|
||||||
// build proxy config
|
// build proxy config
|
||||||
let proxy_config: ProxyConfig = config.try_into()?;
|
let proxy_config: ProxyConfig = config.try_into()?;
|
||||||
// For loggings
|
|
||||||
if proxy_config.listen_sockets.iter().any(|addr| addr.is_ipv6()) {
|
|
||||||
info!("Listen both IPv4 and IPv6")
|
|
||||||
} else {
|
|
||||||
info!("Listen IPv4")
|
|
||||||
}
|
|
||||||
if proxy_config.http_port.is_some() {
|
|
||||||
info!("Listen port: {}", proxy_config.http_port.unwrap());
|
|
||||||
}
|
|
||||||
if proxy_config.https_port.is_some() {
|
|
||||||
info!("Listen port: {} (for TLS)", proxy_config.https_port.unwrap());
|
|
||||||
}
|
|
||||||
if proxy_config.http3 {
|
|
||||||
info!("Experimental HTTP/3.0 is enabled. Note it is still very unstable.");
|
|
||||||
}
|
|
||||||
if !proxy_config.sni_consistency {
|
|
||||||
info!("Ignore consistency between TLS SNI and Host header (or Request line). Note it violates RFC.");
|
|
||||||
}
|
|
||||||
|
|
||||||
///////////////////////////////////
|
///////////////////////////////////
|
||||||
// backend_apps
|
// backend_apps
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@ async fn rpxy_service(
|
||||||
mut config_rx: ReloaderReceiver<ConfigToml>,
|
mut config_rx: ReloaderReceiver<ConfigToml>,
|
||||||
runtime_handle: tokio::runtime::Handle,
|
runtime_handle: tokio::runtime::Handle,
|
||||||
) -> Result<(), anyhow::Error> {
|
) -> Result<(), anyhow::Error> {
|
||||||
|
info!("Start rpxy service");
|
||||||
// Initial loading
|
// Initial loading
|
||||||
config_rx.changed().await?;
|
config_rx.changed().await?;
|
||||||
let config_toml = config_rx.borrow().clone().unwrap();
|
let config_toml = config_rx.borrow().clone().unwrap();
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,25 @@ pub async fn entrypoint<T>(
|
||||||
where
|
where
|
||||||
T: CryptoSource + Clone + Send + Sync + 'static,
|
T: CryptoSource + Clone + Send + Sync + 'static,
|
||||||
{
|
{
|
||||||
|
// For initial message logging
|
||||||
|
if proxy_config.listen_sockets.iter().any(|addr| addr.is_ipv6()) {
|
||||||
|
info!("Listen both IPv4 and IPv6")
|
||||||
|
} else {
|
||||||
|
info!("Listen IPv4")
|
||||||
|
}
|
||||||
|
if proxy_config.http_port.is_some() {
|
||||||
|
info!("Listen port: {}", proxy_config.http_port.unwrap());
|
||||||
|
}
|
||||||
|
if proxy_config.https_port.is_some() {
|
||||||
|
info!("Listen port: {} (for TLS)", proxy_config.https_port.unwrap());
|
||||||
|
}
|
||||||
|
if proxy_config.http3 {
|
||||||
|
info!("Experimental HTTP/3.0 is enabled. Note it is still very unstable.");
|
||||||
|
}
|
||||||
|
if !proxy_config.sni_consistency {
|
||||||
|
info!("Ignore consistency between TLS SNI and Host header (or Request line). Note it violates RFC.");
|
||||||
|
}
|
||||||
|
|
||||||
// build global
|
// build global
|
||||||
let globals = Arc::new(Globals {
|
let globals = Arc::new(Globals {
|
||||||
proxy_config: proxy_config.clone(),
|
proxy_config: proxy_config.clone(),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue