Open bluelavalamp opened 1 month ago
The application automatically selects the device's IP address. You can only choose between localhost, IPv4, IPv6 in "Settings - Server settings - IP" where "All" is automatic.
The method for determining the IP looks like this
val ipAddressInLocalNetwork: String
get() {
val networkInterfaces = NetworkInterface.getNetworkInterfaces().iterator().asSequence()
val localAddresses = networkInterfaces.flatMap {
it.inetAddresses.asSequence()
.filter { inetAddress ->
inetAddress.isSiteLocalAddress && inetAddress.hostAddress?.contains(":") == false &&
inetAddress.hostAddress != "127.0.0.1"
}
.map { inetAddress -> inetAddress.hostAddress }
}
return localAddresses.firstOrNull() ?: "127.0.0.1"
}
In the next version I will experiment and try to give the user a list of all available IPs. (I don't know how successful this will be)
Would it be possible to use the IP address already assigned to the device for WIFI? Or add that selection as an option.
The IP address is being assigned and I can't figure out how to change it. Problem is my netmask is 255.225.0.0 with machines being on 10.0.X.X. But HTTP-FS is picking 10.12.125.48 as the IP address for the server. Is there a way to change it?