openhab-android icon indicating copy to clipboard operation
openhab-android copied to clipboard

Add option to enter hostname/IP

Open ThomDietrich opened this issue 6 years ago • 2 comments

Improvement suggestion.

The local/remote server settings allow for an URL to be entered. Considering, that the openHAB REST API will most probably be available via http(s) on ports 80, 443, 8080 or 8443, it would be nice to also accept a simple hostname/IP in the address field.

ThomDietrich avatar Dec 19 '17 11:12 ThomDietrich

Hey guys,

I think that I can help you with this one, I just need to understand how would you like to present this to the user. Would it be a separated option on the screen or use the same input dialog that exists today to handle an hostname/IP address? Can you give me an example?

heitorcolangelo avatar Oct 01 '19 12:10 heitorcolangelo

I can think of the following: Extend the current url input preference, to accept urls without http:// or https://. If no scheme is entered, try to establish a connection to the following combinations of scheme and port. If one fails, try the next. If one is successful, save scheme + url + port in the settings.

  1. https on port 443
  2. https on port 8443
  3. http on port 80
  4. http on port 8080

mueller-ma avatar Oct 02 '19 08:10 mueller-ma

For local connections discovery is used to enter the correct URL without having to enter the settings at all. For remote connections https:// and https://myopenhab.org are suggested when entering URLs.

I would avoid trying out different ports and protocols as this could lead to:

  1. Send credentials unencrypted, e.g. when openHAB is temporarly down and the app tries http then.
  2. The credentials are sent to unrelated services that run on the same host as openHAB, but on different ports.

mueller-ma avatar Feb 12 '23 21:02 mueller-ma