Medvedev
Medvedev

Reputation: 143

Error: net::ERR_TUNNEL_CONNECTION_FAILED when using proxy with puppeteer on Debian

I am trying to use a proxy with puppeteer on Debian 12.

I purchased the proxy from the froxy service. I also copied the test code from their integration documentation:

import puppeteer from 'puppeteer';
 (async () => {
     const browser = await puppeteer.launch({
     headless: true,
     args: ['--no-sandbox','--proxy-server=proxy.froxy.com:9000'] });
     const page = await browser.newPage();
     await page.authenticate({
         username: 'username',
         password: 'password'
     });
     await page.goto('https://froxy.com/api/detect-ip');
 })()

When running the code on Windows, everything works, the browser starts with the proxy. But when running on Debian, I get the error:

file:///root/parsing/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/Frame.js:180
                        ? new Error(`${response.errorText} at ${url}`)
                          ^

Error: net::ERR_TUNNEL_CONNECTION_FAILED at
https://froxy.com/api/detect-ip
    at navigate (file:///root/parsing/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/Frame.js:180:27)
    at async Deferred.race (file:///root/parsing/node_modules/puppeteer-core/lib/esm/puppeteer/util/Deferred.js:33:20)
    at async CdpFrame.goto (file:///root/parsing/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/Frame.js:146:25)
    at async CdpPage.goto (file:///root/parsing/node_modules/puppeteer-core/lib/esm/puppeteer/api/Page.js:563:20)
    at async file:///root/parsing/tets.js:11:6

Node.js v22.9.0

What could be causing the error, where should I look?

Upvotes: 0

Views: 31

Answers (0)

Related Questions