Skip to content

Commit c9f9f53

Browse files
committed
Fixed /discovery/list not returning available clients (#352)
1 parent edb8f16 commit c9f9f53

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

api/src/main/java/xyz/gianlu/librespot/api/handlers/DiscoveryHandler.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,34 @@
2121
import io.undertow.server.HttpHandler;
2222
import io.undertow.server.HttpServerExchange;
2323
import io.undertow.util.Headers;
24+
import org.slf4j.Logger;
25+
import org.slf4j.LoggerFactory;
2426
import xyz.gianlu.librespot.ZeroconfServer;
2527
import xyz.gianlu.librespot.api.Utils;
2628
import xyz.gianlu.zeroconf.DiscoveredService;
2729
import xyz.gianlu.zeroconf.Zeroconf;
2830

31+
import java.io.IOException;
2932
import java.util.Deque;
3033
import java.util.Map;
3134

3235
/**
3336
* @author devgianlu
3437
*/
3538
public final class DiscoveryHandler implements HttpHandler {
39+
private static final Logger LOGGER = LoggerFactory.getLogger(DiscoveryHandler.class);
3640
private final Zeroconf zeroconf;
3741

3842
public DiscoveryHandler() {
39-
zeroconf = new Zeroconf();
43+
zeroconf = new Zeroconf()
44+
.setUseIpv4(true)
45+
.setUseIpv6(false);
46+
47+
try {
48+
zeroconf.addAllNetworkInterfaces();
49+
} catch (IOException ex) {
50+
LOGGER.error("Failed adding network interfaces for Zeroconf.", ex);
51+
}
4052
}
4153

4254
@Override

lib/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
<dependency>
117117
<groupId>xyz.gianlu.zeroconf</groupId>
118118
<artifactId>zeroconf</artifactId>
119-
<version>1.2.1</version>
119+
<version>1.2.2</version>
120120
</dependency>
121121

122122
<!-- HTTP -->

0 commit comments

Comments
 (0)