aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs
index eb91b05..38fae53 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -20,6 +20,7 @@ use std::{fs::File, io::BufReader, net::SocketAddr, path::Path, sync::Arc};
use tokio::{
io::{AsyncRead, AsyncWrite},
net::{TcpListener, TcpStream},
+ signal::ctrl_c,
};
use tokio_rustls::TlsAcceptor;
@@ -42,10 +43,9 @@ async fn main() -> anyhow::Result<()> {
))?;
let config = Arc::new(Config::load(&config_path)?);
- tokio::select! {
- x = serve_http(config.clone()) => x.context("serving http")?,
- x = serve_https(config.clone()) => x.context("serving https")?,
- };
+ tokio::spawn(serve_http(config.clone()));
+ tokio::spawn(serve_https(config.clone()));
+ ctrl_c().await.unwrap();
Ok(())
}