From bfaf72b3038c3c8cad6d5e68f9f2ad3a49c2a9fc Mon Sep 17 00:00:00 2001 From: Emilien <4016501+unixfox@users.noreply.github.com> Date: Mon, 30 Dec 2024 21:52:34 +0100 Subject: [PATCH] skip proxy for invidious companion --- src/invidious/yt_backend/connection_pool.cr | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/invidious/yt_backend/connection_pool.cr b/src/invidious/yt_backend/connection_pool.cr index c4a73aa7..060e5e2b 100644 --- a/src/invidious/yt_backend/connection_pool.cr +++ b/src/invidious/yt_backend/connection_pool.cr @@ -61,9 +61,9 @@ def add_yt_headers(request) end end -def make_client(url : URI, region = nil, force_resolve : Bool = false, force_youtube_headers : Bool = false) +def make_client(url : URI, region = nil, force_resolve : Bool = false, force_youtube_headers : Bool = false, use_http_proxy : Bool = true) client = HTTP::Client.new(url) - client.proxy = make_configured_http_proxy_client() if CONFIG.http_proxy + client.proxy = make_configured_http_proxy_client() if CONFIG.http_proxy && use_http_proxy # Force the usage of a specific configured IP Family if force_resolve @@ -78,8 +78,8 @@ def make_client(url : URI, region = nil, force_resolve : Bool = false, force_you return client end -def make_client(url : URI, region = nil, force_resolve : Bool = false, &) - client = make_client(url, region, force_resolve: force_resolve) +def make_client(url : URI, region = nil, force_resolve : Bool = false, use_http_proxy : Bool = true, &) + client = make_client(url, region, force_resolve: force_resolve, use_http_proxy: use_http_proxy) begin yield client ensure