From 91e55d1c13ec017ce52c82e55bb9b552c86a0381 Mon Sep 17 00:00:00 2001 From: wikeolf Date: Wed, 7 Aug 2024 09:18:57 +0800 Subject: [PATCH] remove ip4p resolveing surplus port imformation --- phantun/src/utils.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phantun/src/utils.rs b/phantun/src/utils.rs index 4b9fb85..709eb62 100644 --- a/phantun/src/utils.rs +++ b/phantun/src/utils.rs @@ -71,7 +71,7 @@ pub async fn lookup_host(domain: &str, ip4p_resolve: bool, ipv4_only: bool) -> s } fn resolve_ip4p_domain(domain: &str) -> std::net::SocketAddr { - let ip4p_addr = dns_lookup::lookup_host(domain).unwrap(); + let ip4p_addr = dns_lookup::lookup_host(domain.trim_end_matches(":0")).unwrap(); let ip4p_addr = ip4p_addr[0].to_string(); let ip4p_resolve: Vec<&str> = ip4p_addr.split(':').collect(); if ip4p_resolve.len() != 5 {