aboutsummaryrefslogtreecommitdiffstats
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, 8 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 1432a1a..c60e153 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -227,6 +227,7 @@ async fn run(miniserve_config: MiniserveConfig) -> Result<(), ContextualError> {
.default_service(web::get().to(error_404))
});
+ #[cfg(feature = "tls")]
let srv = if let Some(tls_config) = miniserve_config.tls_rustls_config {
srv.bind_rustls(socket_addresses.as_slice(), tls_config)
.map_err(|e| ContextualError::IoError("Failed to bind server".to_string(), e))?
@@ -239,6 +240,13 @@ async fn run(miniserve_config: MiniserveConfig) -> Result<(), ContextualError> {
.run()
};
+ #[cfg(not(feature = "tls"))]
+ let srv = srv
+ .bind(socket_addresses.as_slice())
+ .map_err(|e| ContextualError::IoError("Failed to bind server".to_string(), e))?
+ .shutdown_timeout(0)
+ .run();
+
println!(
"Serving path {path} at {addresses}",
path = Color::Yellow.paint(path_string).bold(),