How to find out if a device is on the 'local' network?
Unsolved
General and Desktop
-
I implemented a www-frontend to music app.
So far so good.
I'd like to access this www frontend from outside my local network, however, my play buttons should not be displayed when the app is accessed from outside my local network.
How doI detect if the www-connection is 'inside' my local network or not?Any pointers, tips or hints are greatly appreciated.
Thanks,
Roy -
Adding to @JonB:
Checking against a (hard coded) subnet is a quick and easy way.
It doesn't cover the case where the music server is offline.
You have maybe implemented a "Status" function, that displays the server status (playing, ready, error) on the www-frontend. That would be an additional check: Enable the buttons only if the status can be queried (and it's not "error").