Revert "Fix ME proxy config parser to support IPv6 addresses"

This reverts commit 0f40771223.
This commit is contained in:
Igor 2026-02-18 10:52:12 +03:00
parent 0f40771223
commit 319af0e291
1 changed files with 1 additions and 2 deletions

View File

@ -48,8 +48,7 @@ pub async fn fetch_proxy_config(url: &str) -> Result<ProxyConfigData> {
.await .await
.map_err(|e| crate::error::ProxyError::Proxy(format!("fetch_proxy_config read failed: {e}")))?; .map_err(|e| crate::error::ProxyError::Proxy(format!("fetch_proxy_config read failed: {e}")))?;
// Matches both IPv4 `host:port` and IPv6 `[host]:port` formats let re_proxy = Regex::new(r"proxy_for\s+(-?\d+)\s+([^\s:]+):(\d+)\s*;").unwrap();
let re_proxy = Regex::new(r"proxy_for\s+(-?\d+)\s+\[?([^\]\s]+)\]?:(\d+)\s*;").unwrap();
let re_default = Regex::new(r"default\s+(-?\d+)\s*;").unwrap(); let re_default = Regex::new(r"default\s+(-?\d+)\s*;").unwrap();
let mut map: HashMap<i32, Vec<(IpAddr, u16)>> = HashMap::new(); let mut map: HashMap<i32, Vec<(IpAddr, u16)>> = HashMap::new();