mirror of
https://github.com/haorendashu/nowser.git
synced 2025-12-18 10:04:20 +01:00
add buildin relay support, fix remote signer some bugs
This commit is contained in:
19
lib/util/ip_util.dart
Normal file
19
lib/util/ip_util.dart
Normal file
@@ -0,0 +1,19 @@
|
||||
import 'dart:io';
|
||||
|
||||
class IpUtil {
|
||||
static Future<String?> getIp() async {
|
||||
var ips = await NetworkInterface.list();
|
||||
for (var interface in ips) {
|
||||
print('== Interface: ${interface.name} ==');
|
||||
if (interface.name == "WLAN") {
|
||||
for (var addr in interface.addresses) {
|
||||
print(
|
||||
'${addr.address} ${addr.host} ${addr.isLoopback} ${addr.rawAddress} ${addr.type.name}');
|
||||
return addr.address;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ips.first.addresses.first.address;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user