feat: add cli options for the interface to listen on

This commit is contained in:
Himadri Bhattacharjee
2025-04-20 07:26:11 +05:30
parent 193bfdc390
commit 71faebde2b

View File

@@ -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]