feat: use rust impl checkHost

This commit is contained in:
xkeyC
2025-11-25 21:19:36 +08:00
parent 3c07d12ee9
commit da7c4b958d
9 changed files with 276 additions and 94 deletions

View File

@@ -34,4 +34,19 @@ Future<List<String>> dnsLookupTxt({required String host}) =>
Future<List<String>> dnsLookupIps({required String host}) =>
RustLib.instance.api.crateApiHttpApiDnsLookupIps(host: host);
/// Get the fastest URL from a list of URLs by testing them concurrently.
/// Returns the first URL that responds successfully, canceling other requests.
///
/// # Arguments
/// * `urls` - List of base URLs to test
/// * `path_suffix` - Optional path suffix to append to each URL (e.g., "/api/version")
/// If None, tests the base URL directly
Future<String?> getFasterUrl({
required List<String> urls,
String? pathSuffix,
}) => RustLib.instance.api.crateApiHttpApiGetFasterUrl(
urls: urls,
pathSuffix: pathSuffix,
);
enum MyMethod { options, gets, post, put, delete, head, trace, connect, patch }

View File

@@ -6,7 +6,6 @@
import '../frb_generated.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';
// These functions are ignored because they are not marked as `pub`: `get_process_path`
// These function are ignored because they are on traits that is not defined in current crate (put an empty `#[frb]` on it to unignore): `clone`, `fmt`
Future<void> sendNotify({