From d496f3768d0ab76b142fe827e30c9acf8ab1dfd5 Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 20 Dec 2023 18:17:28 -0600 Subject: [PATCH] always use ipv4 --- src/engines/mod.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/engines/mod.rs b/src/engines/mod.rs index 9eaeac2..fb4f49b 100644 --- a/src/engines/mod.rs +++ b/src/engines/mod.rs @@ -1,6 +1,8 @@ use std::{ collections::{BTreeSet, HashMap}, + net::IpAddr, ops::Deref, + str::FromStr, sync::LazyLock, time::Instant, }; @@ -294,7 +296,12 @@ pub async fn autocomplete_with_engines( Ok(merge_autocomplete_responses(autocomplete_results)) } -pub static CLIENT: LazyLock = LazyLock::new(|| reqwest::Client::new()); +pub static CLIENT: LazyLock = LazyLock::new(|| { + reqwest::ClientBuilder::new() + .local_address(IpAddr::from_str("0.0.0.0").unwrap()) + .build() + .unwrap() +}); pub async fn search( query: SearchQuery,