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

Add REST-Method to ARE that returns the current local IP address, for FAQ #105

Open
klues opened this issue Nov 8, 2017 · 1 comment
Open

Comments

@klues
Copy link
Contributor

klues commented Nov 8, 2017

FAQ 38 (see: https://asterics.github.io/AsTeRICS-Ergo/mock.html#!/home/envcontrol/help/faq/38) currently uses a Javascript-Hack in order to get the current local IP-address. However it only works in chrome and Firefox, not in IE or Edge.

In order to show correct info in this FAQ also in IE/Edge we would need a ARE-Rest method that returns the current local IP address.

@klues
Copy link
Contributor Author

klues commented Nov 8, 2017

in order to also support Edge/IE for showing the correct local IP in the Smartphone-FAQ, we maybe could add a REST-method that returns the current local IP, with some snippet like this:

Enumeration< NetworkInterface > interfaces = NetworkInterface.getNetworkInterfaces( );
List<NetworkInterface> list = new ArrayList<>();
while(interfaces.hasMoreElements()) {
    NetworkInterface element = interfaces.nextElement();
    if(element.isUp() && element.getName().startsWith("wlan")) {
        list.add(element);
    }
}
list.get(0).getInetAddresses();

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

No branches or pull requests

1 participant