From 240c8f0f221cff568eac537c99cc8e2426b18757 Mon Sep 17 00:00:00 2001 From: Emilien <4016501+unixfox@users.noreply.github.com> Date: Sun, 2 Aug 2026 12:42:56 +0200 Subject: [PATCH] chore: make it compatible with socks proxy --- src/invidious/routes/proxy.cr | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/invidious/routes/proxy.cr b/src/invidious/routes/proxy.cr index 0b331277..9f0e032c 100644 --- a/src/invidious/routes/proxy.cr +++ b/src/invidious/routes/proxy.cr @@ -178,9 +178,10 @@ module Invidious::Routes::Proxy # mid-stream (backoff / reload / seek). begin client = HTTP::Client.new(target_url.host.not_nil!, tls: true) - # Route the googlevideo/youtubei egress through the configured HTTP proxy when - # set (e.g. to bypass a YouTube IP block on the instance's own address). - client.proxy = make_configured_http_proxy_client() if CONFIG.http_proxy + # Route the googlevideo/youtubei egress through the configured proxy when set + # (HTTP CONNECT or SOCKS5, e.g. to bypass a YouTube IP block on the instance's + # own address). Uses the same dispatcher as the rest of the codebase. + configure_proxy(client) if CONFIG.http_proxy client.connect_timeout = 10.seconds client.read_timeout = 30.seconds # Don't let HTTP::Client advertise its own Accept-Encoding; we forward the