diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fb79f05..494c0e85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,7 @@ https://github.com/librespot-org/librespot - [core] `Credentials.username` is now an `Option` (breaking) - [core] `Session::connect` tries multiple access points, retrying each one. - [core] Each access point connection now timesout after 3 seconds. +- [core] Listen on both IPV4 and IPV6 on non-windows hosts - [main] `autoplay {on|off}` now acts as an override. If unspecified, `librespot` now follows the setting in the Connect client that controls it. (breaking) - [metadata] Most metadata is now retrieved with the `spclient` (breaking) diff --git a/discovery/src/server.rs b/discovery/src/server.rs index 0e235f77..f3c979b9 100644 --- a/discovery/src/server.rs +++ b/discovery/src/server.rs @@ -2,7 +2,7 @@ use std::{ borrow::Cow, collections::BTreeMap, convert::Infallible, - net::{Ipv4Addr, SocketAddr, TcpListener}, + net::{Ipv4Addr, Ipv6Addr, SocketAddr, TcpListener}, pin::Pin, sync::{Arc, Mutex}, task::{Context, Poll}, @@ -266,7 +266,12 @@ pub struct DiscoveryServer { impl DiscoveryServer { pub fn new(config: Config, port: &mut u16) -> Result { let (discovery, cred_rx) = RequestHandler::new(config); - let address = SocketAddr::new(Ipv4Addr::UNSPECIFIED.into(), *port); + let address = if cfg!(windows) { + SocketAddr::new(Ipv4Addr::UNSPECIFIED.into(), *port) + } else { + // this creates a dual stack socket on non-windows systems + SocketAddr::new(Ipv6Addr::UNSPECIFIED.into(), *port) + }; let (close_tx, close_rx) = oneshot::channel();