Skip cookie validation with InitConf, use 0.0.0.0 for loopback

This commit is contained in:
Prabhpreet Dua
2024-04-16 12:57:01 +05:30
parent 10bdb5f371
commit a32efb61d1
2 changed files with 40 additions and 63 deletions

View File

@@ -35,7 +35,7 @@ fn generate_keys() {
fn find_udp_socket() -> Option<u16> {
for port in 1025..=u16::MAX {
if UdpSocket::bind(("127.0.0.1", port)).is_ok() {
if UdpSocket::bind(("0.0.0.0", port)).is_ok() {
return Some(port);
}
}
@@ -150,7 +150,7 @@ fn check_exchange_under_normal() {
}
};
let listen_addr = format!("127.0.0.1:{port}");
let listen_addr = format!("0.0.0.0:{port}");
let mut server_cmd = std::process::Command::new(BIN);
server_cmd
@@ -223,7 +223,7 @@ fn check_exchange_under_dos() {
}
};
let listen_addr = format!("127.0.0.1:{port}");
let listen_addr = format!("0.0.0.0:{port}");
let mut server_cmd = std::process::Command::new(BIN);