diff --git a/src/main/kotlin/net/schowek/nextclouddlna/util/ServerInfoProvider.kt b/src/main/kotlin/net/schowek/nextclouddlna/util/ServerInfoProvider.kt index e81f7d5..1473442 100644 --- a/src/main/kotlin/net/schowek/nextclouddlna/util/ServerInfoProvider.kt +++ b/src/main/kotlin/net/schowek/nextclouddlna/util/ServerInfoProvider.kt @@ -47,6 +47,9 @@ class ServerInfoProviderImpl( } } + // perform fake request to 1.1.1.1:80 just to get the localAddress + // with use of the default routing. + // if it fails, we use the localAddress() which can be wrong private fun guessLocalAddress() = try { DatagramSocket().use { s -> s.connect(InetAddress.getByAddress(byteArrayOf(1, 1, 1, 1)), 80)