diff options
author | metamuffin <metamuffin@disroot.org> | 2024-09-28 21:50:34 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-09-28 21:50:34 +0200 |
commit | eb379e405d18c72e169124e138961caeda3d4c54 (patch) | |
tree | 7c32ff3ea23829a635540e49f944e39e57654c45 /server/discover | |
parent | 6f2109a3321102f622d9ca05483f00b5ad936249 (diff) | |
download | hurrycurry-eb379e405d18c72e169124e138961caeda3d4c54.tar hurrycurry-eb379e405d18c72e169124e138961caeda3d4c54.tar.bz2 hurrycurry-eb379e405d18c72e169124e138961caeda3d4c54.tar.zst |
fix ip v6 formatting in discovery
Diffstat (limited to 'server/discover')
-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") |