From 737b03172c2e063ba311c23d6552418bd2ab1955 Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Mon, 3 Nov 2025 02:08:10 +0000 Subject: fix: metascraper logo to go through proxy if one configured. fixes #1863 --- apps/workers/workers/crawlerWorker.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'apps') diff --git a/apps/workers/workers/crawlerWorker.ts b/apps/workers/workers/crawlerWorker.ts index ae7cfcab..357ae976 100644 --- a/apps/workers/workers/crawlerWorker.ts +++ b/apps/workers/workers/crawlerWorker.ts @@ -12,6 +12,8 @@ import DOMPurify from "dompurify"; import { eq } from "drizzle-orm"; import { execa } from "execa"; import { exitAbortController } from "exit"; +import { HttpProxyAgent } from "http-proxy-agent"; +import { HttpsProxyAgent } from "https-proxy-agent"; import { JSDOM, VirtualConsole } from "jsdom"; import metascraper from "metascraper"; import metascraperAmazon from "metascraper-amazon"; @@ -129,7 +131,18 @@ const metascraperParser = metascraper([ metascraperDescription(), metascraperTwitter(), metascraperImage(), - metascraperLogo(), + metascraperLogo({ + gotOpts: { + agent: { + http: serverConfig.proxy.httpProxy + ? new HttpProxyAgent(getRandomProxy(serverConfig.proxy.httpProxy)) + : undefined, + https: serverConfig.proxy.httpsProxy + ? new HttpsProxyAgent(getRandomProxy(serverConfig.proxy.httpsProxy)) + : undefined, + }, + }, + }), metascraperUrl(), ]); -- cgit v1.2.3-70-g09d2