diff --git a/src/bin/cli.rs b/src/bin/cli.rs index b07c9a3..6c00c72 100644 --- a/src/bin/cli.rs +++ b/src/bin/cli.rs @@ -1,4 +1,5 @@ use std::sync::atomic::Ordering; +use std::net::IpAddr; use clap::Parser; use tg_unblock::{bypass, network, ws_proxy}; @@ -22,6 +23,12 @@ struct Args { fn main() { let args = Args::parse(); + // Validate bind address early + if args.bind.parse::().is_err() { + eprintln!("[!] Неверный адрес привязки: {}", args.bind); + std::process::exit(1); + } + let is_admin = bypass::check_admin(); let mut dns_was_set = false; let mut adapter_name: Option = None;