Connecting to remote URL when on local network
See original GitHub issueActual behaviour
All happens when I’m connected to my home network. When I launch the app, it initially connects to the local URL and it responds fast, as expected. If I move the app to the background and open it again after a while it says “Connecting to remote URL” and the response is much slower so it is clear that it gets it data over the internet. If this happens and I completely close the app and reopen it, it connects to the local url again.
Expected behaviour
I expect the app to always connect to the local url while on the home network.
Steps to reproduce
See “Actual behaviour”
Environment data
Client
- Android version: 8.0.0
- Device model: Galaxy S8
- Stock or customized ROM: Stock ROM
- App version : 2.3.0
- Build flavor : Play Store
- Device language: Dutch
Server
- Server version: 2.4.0 M4 (but the problem also existed on 2.3.0).
- Reverse Proxy: No
- Authentication method : None
openHAB Cloud
- openHAB Cloud version: No idea.
- Self hosted cloud or myopenhab.org: myopenhab.org
- Authentication method : User and password.
Logs
App log
Where can I get it?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Reaching a device in my LAN from the Internet - Super User
Whenever you want to work remotely, connect to the VPN, and you will see the embedded device as if it were on a...
Read more >Access server using URL locally without going through Internet
When I connect to it from anywhere I connect successfully and everything is fine. But when I connect to it locally, within the...
Read more >Connecting to remote URL when on local network without ...
I expect the app to always try to connect to the local url while on the home network, wether the home network has...
Read more >Access to a site on localhost from remote - Stack Overflow
For this scenario we should use VPN services. We should connect our local machine to VPN then in other side we should connect...
Read more >Remote Desktop - Allow access to your PC from outside your ...
Learn about your options for remotely accessing your PC from outside the PC's network.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Maybe if we’re on a local network and can’t connect to the local server, we should regularly retry to connect to the local server?
I think the problem is that the app sometimes failes to connect to the local server, connects to the remote one and as long there is a connection to some server, the app doesn’t try to connect to a specific one (with exceptions for e.g. notifications that are always fetched from the remote server). I guess https://github.com/openhab/openhab-android/pull/780 could fix this issue.