|
|
@@ -169,6 +169,7 @@ impl RendezvousServer {
|
|
169
|
169
|
) -> ResultType<()> {
|
|
170
|
170
|
log::info!("Listening on tcp/udp {}", addr);
|
|
171
|
171
|
log::info!("Listening on tcp {}, extra port for NAT test", addr2);
|
|
|
172
|
+ log::info!("relay-servers={:?}", relay_servers);
|
|
172
|
173
|
let mut socket = FramedSocket::new(addr).await?;
|
|
173
|
174
|
let (tx, mut rx) = mpsc::unbounded_channel::<(RendezvousMessage, SocketAddr)>();
|
|
174
|
175
|
let version = hbb_common::get_version_from_url(&software_url);
|
|
|
@@ -223,6 +224,9 @@ impl RendezvousServer {
|
|
223
|
224
|
Ok((stream, addr)) = listener.accept() => {
|
|
224
|
225
|
log::debug!("Tcp connection from {:?}", addr);
|
|
225
|
226
|
if let Ok(local_addr) = stream.local_addr() {
|
|
|
227
|
+ if PUBLIC_IP.write().unwrap().is_empty() {
|
|
|
228
|
+ log::info!("Public ip is {}", local_addr.ip().to_string());
|
|
|
229
|
+ }
|
|
226
|
230
|
*PUBLIC_IP.write().unwrap() = local_addr.ip().to_string();
|
|
227
|
231
|
}
|
|
228
|
232
|
let (a, mut b) = Framed::new(stream, BytesCodec::new()).split();
|
|
|
@@ -708,7 +712,7 @@ pub fn test_if_valid_server(host: &str, name: &str) -> ResultType<SocketAddr> {
|
|
708
|
712
|
|
|
709
|
713
|
fn check_relay_server(addr: &str) -> String {
|
|
710
|
714
|
if addr.contains("0.0.0.0") {
|
|
711
|
|
- return addr.replace("0.0.0.0", &*PUBLIC_IP.read().unwrap());
|
|
|
715
|
+ return addr.replace("0.0.0.0", &PUBLIC_IP.read().unwrap());
|
|
712
|
716
|
}
|
|
713
|
717
|
addr.to_owned()
|
|
714
|
718
|
}
|