Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set IP address? #50

Open
bluelavalamp opened this issue Sep 6, 2024 · 3 comments
Open

How to set IP address? #50

bluelavalamp opened this issue Sep 6, 2024 · 3 comments

Comments

@bluelavalamp
Copy link

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?

@Tiarait
Copy link
Owner

Tiarait commented Sep 8, 2024

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)

@bluelavalamp
Copy link
Author

Would it be possible to use the IP address already assigned to the device for WIFI? Or add that selection as an option.

@QueenBiah
Copy link

10.0.0.24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants