
Keeps sending datagram UDP packets to each connected host on the same port range and keeps waiting for replies.there isn't much we can do, is there ? 😄) (This only works if the switch is not blocking ICMP requests. The DeepScan consists of sending ICMP ECHO requests to the list of the possible network IPs that was calculated before.So if you choose to do so, the package falls back to a DeepScan. If it does not find any hosts, either there aren't any or the switch is blocking subnet broadcast packets.Keeps sending datagram UDP packets to the subnet broadcast IP address and the port range of your choosing, and keeps waiting for hosts on the subnet to respond for a specified timeout.Calculates the list of the possible IP Addresses on the network using the fetched device IP address and netmask.And this is where react-native-lanscan comes in handy. But there are switches and routers that tend to block mDNS Registry and Discovery.

Take a look at the awesome react-native-zeroconf package by Balthazar Gronon. There are more suitable ways of finding services on the local network like mDNS of the Zero-configuration standard (implementations like Avahi, Bonjour or NSD). Please keep in mind that this is a fallback method. Use the React Native official NetInfo API. Please take your precautions and check if the device is connected to the network with Wi-Fi first as this package doesn't do that for you. This package scans the LAN network of the device via Wi-Fi and searches for hosts with services on a port range of your choosing. So no need to add the permission to your app module AndroidManifest. On android, this package adds another request for the _WIFI_STATE permission for your app in the package manifest.
Download lanscan free#
Feel free to submit a PR of an iOS port I'll be happy to merge ! 😃 Permissions


Download lanscan android#
This package is only supported on android devices, since I'm not much of an iOS Developer. A React Native library for scanning LAN IPs and ports to find services via device Wi-Fi Support
