From b52fbca4fd8c3148b2a2b2d5128967eceded625e Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Thu, 22 Aug 2024 08:59:31 +0200 Subject: [PATCH] Fix listen host --- src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 51982f1..6d89bc8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -21,6 +21,9 @@ struct Args { /// Maximal port this server will listen to #[arg(short('M'), long, default_value_t = 1000)] max_port: u16, + /// Host this server will listen to + #[arg(short, long, default_value="0.0.0.0")] + listen_host: String, } #[actix_web::main] @@ -47,7 +50,7 @@ async fn main() -> std::io::Result<()> { .wrap(Logger::default()) .route("/", web::get().to(home)) }) - .bind(("127.0.0.1", port))? + .bind((args.listen_host, port))? .run() .await }