ivirtex/lan_scanner
다중 스레드 ICMP 핑을 통해 로컬 네트워크(LAN)의 네트워크 장치를 탐지할 수 있는 Dart/Flutter 패키지입니다.
- Stars
- 27
- Forks
- 4
- 최근 푸시(UTC)
- 2023. 8. 5.
- 프로젝트 상태
- 보관됨
기술 주제
사용 중인 의존성
의존성 목록 4 개
- dart_ping
^9.0.0 - import_sorter개발 의존성
^4.6.0 - test개발 의존성
^1.24.5 - very_good_analysis개발 의존성
^5.0.0+1
원본 README
아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
README 펼치기 / 접기
lan_scanner
pub.dev badge GitHub build status
Dart / Flutter package that allows discovering network devices in local network (LAN) via multi-threaded ICMP pings.
Note: This library is intended to be used on Class C networks.
Getting Started
Add the package to your pubspec.yaml:
lan_scanner: ^4.0.0
Import the library:
import 'package:lan_scanner/lan_scanner.dart';
Create an instance of the class and call
quickIcmpScanAsync() on it:
final scanner = LanScanner();
final List<Host> hosts = scanner.quickIcmpScanAsync('192.168.0');
There is also stream-based icmpScan() method available, which provides progress callback, but is much slower and resource hungry than other methods.
If you don't know what subnet to provide, you can use network_info_plus to get your local IP and then ipToCSubnet() function, which will conviently strip the last octet of the IP address:
// 192.168.0.1
var wifiIP = await NetworkInfo().getWifiIP()
// 192.168.0
var subnet = ipToCSubnet(wifiIP);
iOS compatibility
Due to the issue with Flutter platform channels (#119207), iOS platform is currently supported only when using the quickIcmpScanSync() method and requires additional steps:
Add dart_ping_ios to your pubspec.yaml:
dart_ping_ios: ^4.0.0
Call register() method before running your app:
void main() {
DartPingIOS.register();
runApp(const App());
}
Configuration
Warning:
In order to use this package, you may need to do additional configuration on some platforms.
Android:
Add the android.permission.INTERNET to your AndroidManifest.xml file:
<uses-permission android:name="android.permission.INTERNET" />
MacOS:
Add following key to DebugProfile.entitlements and Release.entitlements files:
<key>com.apple.security.network.client</key>
<true/>
Features, bugs and contributions
Feel free to contribute to this project.
Please file feature requests and bugs at the issue tracker.
If you fixed a bug or implemented a feature by yourself, feel free to send a pull request.
Sponsoring
I am working on my packages in my free time.
If this package is helping you, please consider buying me a coffee, so I can keep updating and maintaining this package.