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 }