Change dst socket address

main
shellrow 3 years ago
parent 1b18892749
commit 2ec91d6d1b
  1. 2
      src/gateway.rs
  2. 2
      src/interface.rs

@ -60,7 +60,7 @@ fn send_udp_packet(){
Ok(s) => s, Ok(s) => s,
Err(e) => panic!("Error happened {}", e), Err(e) => panic!("Error happened {}", e),
}; };
let dest: &str = "8.8.8.8:80"; let dest: &str = "1.1.1.1:80";
socket.set_ttl(1).unwrap(); socket.set_ttl(1).unwrap();
socket.send_to(&buf, dest).unwrap(); socket.send_to(&buf, dest).unwrap();
} }

@ -98,7 +98,7 @@ fn get_local_ipaddr() -> Option<String> {
Err(_) => return None, Err(_) => return None,
}; };
match socket.connect("8.8.8.8:80") { match socket.connect("1.1.1.1:80") {
Ok(()) => (), Ok(()) => (),
Err(_) => return None, Err(_) => return None,
}; };

Loading…
Cancel
Save