From 71faebde2b2791b8ffec57bcac1facde04adaab6 Mon Sep 17 00:00:00 2001 From: Himadri Bhattacharjee <107522312+lavafroth@users.noreply.github.com> Date: Sun, 20 Apr 2025 07:26:11 +0530 Subject: [PATCH] feat: add cli options for the interface to listen on --- src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 696d839..4282580 100644 --- a/src/main.rs +++ b/src/main.rs @@ -92,7 +92,7 @@ impl AppServer { )?], ..Default::default() }; - self.run_on_address(Arc::new(config), ("0.0.0.0", self.args.port)) + self.run_on_address(Arc::new(config), (self.args.host.clone(), self.args.port)) .await?; Ok(()) } @@ -663,6 +663,9 @@ struct Args { /// Port to listen on for incoming connections #[arg(long, short, default_value = "2222")] port: u16, + /// Interface on the host to listen on + #[arg(long, default_value = "0.0.0.0")] + host: String, } #[tokio::main]