diff options
Diffstat (limited to 'server/discover/src/main.rs')
-rw-r--r-- | server/discover/src/main.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/server/discover/src/main.rs b/server/discover/src/main.rs index fabf7946..f1f2bb35 100644 --- a/server/discover/src/main.rs +++ b/server/discover/src/main.rs @@ -26,7 +26,7 @@ use hyper::{ use hyper_util::rt::TokioIo; use log::warn; use mdns_sd::{ServiceDaemon, ServiceEvent}; -use std::{cmp::Reverse, collections::HashMap, sync::Arc}; +use std::{cmp::Reverse, collections::HashMap, net::SocketAddr, sync::Arc}; use tokio::{net::TcpListener, spawn, sync::RwLock}; fn main() -> Result<()> { @@ -58,7 +58,9 @@ async fn async_main() -> Result<!> { address: service_info .get_addresses() .into_iter() - .map(|a| format!("ws://{a}:{}", service_info.get_port())) + .map(|a| { + format!("ws://{}", SocketAddr::new(*a, service_info.get_port())) + }) .collect(), players_online: service_info .get_property_val_str("players") |