Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to find out if a device is on the 'local' network?
Forum Updated to NodeBB v4.3 + New Features

How to find out if a device is on the 'local' network?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 281 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TheFlyingMooseMan
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      Do you mean get the IP address of the Url and compare against your own IP address to figure this?

      T 1 Reply Last reply
      0
      • Axel SpoerlA Offline
        Axel SpoerlA Offline
        Axel Spoerl
        Moderators
        wrote on last edited by
        #3

        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").

        Software Engineer
        The Qt Company, Oslo

        1 Reply Last reply
        0
        • JonBJ JonB

          Do you mean get the IP address of the Url and compare against your own IP address to figure this?

          T Offline
          T Offline
          TheFlyingMooseMan
          wrote on last edited by
          #4

          @JonB : yes

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved