最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

node.js - Error: net::ERR_TUNNEL_CONNECTION_FAILED when using proxy with puppeteer on Debian - Stack Overflow

programmeradmin5浏览0评论

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:9000'] });
     const page = await browser.newPage();
     await page.authenticate({
         username: 'username',
         password: 'password'
     });
     await page.goto('');
 })()

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

    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?

发布评论

评论列表(0)

  1. 暂无评论