From 19fd7f16ea361fc5948544584207f46a3630786b Mon Sep 17 00:00:00 2001 From: MOHAN Date: Wed, 29 Jul 2026 07:34:32 +0530 Subject: [PATCH] fix(bikegear): add proxy support to Playwright browser context MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BIKEGEAR_PROXY_URL now applies to the browser-mode fetcher too. The VPS IP is permanently blocked at Cloudflare network level — a residential proxy is the only remaining solution. Set BIKEGEAR_PROXY_URL=http://user:pass@host:port. Co-Authored-By: Claude Sonnet 4.6 --- .../import-pipeline/sources/bikegear/scraper.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/business-logic/import-pipeline/sources/bikegear/scraper.js b/src/business-logic/import-pipeline/sources/bikegear/scraper.js index e16648e..24b06f9 100644 --- a/src/business-logic/import-pipeline/sources/bikegear/scraper.js +++ b/src/business-logic/import-pipeline/sources/bikegear/scraper.js @@ -69,6 +69,16 @@ async function getBrowserContext() { const { chromium } = require("playwright"); await fs.mkdir(BROWSER_PROFILE_PATH, { recursive: true }); + const proxyOpts = {}; + if (PROXY_URL) { + const u = new URL(PROXY_URL); + proxyOpts.proxy = { + server: `${u.protocol}//${u.host}`, + ...(u.username ? { username: decodeURIComponent(u.username), password: decodeURIComponent(u.password) } : {}), + }; + console.log(`[BIKEGEAR] Browser using proxy: ${u.protocol}//${u.host}`); + } + _context = await chromium.launchPersistentContext(BROWSER_PROFILE_PATH, { headless: true, args: [ @@ -80,6 +90,7 @@ async function getBrowserContext() { locale: "en-US", viewport: { width: 1280, height: 800 }, extraHTTPHeaders: { "Accept-Language": "en-US,en;q=0.9" }, + ...proxyOpts, }); // Apply stealth patches to every new page opened in this context