`puppeteer-page-proxy`带有`https`有错误:net :: err_failed或rfc 6066错误

发布于 2025-01-25 04:40:24 字数 4991 浏览 2 评论 0原文

我使用 puppeteer puppeteer-page-proxy 代理。

我没有使用args的问题:[' - proxy-server = socks5://127.0.0.1:9150',...带有httphttps

我对useproxy方法和http网站没有问题。

我只有useproxy方法和https网站有问题。

版本:

node v17.2.0
Chromium Version 101.0.4950.0 (Developer Build) (64-bit)
+-- [email protected]
+-- [email protected]

示例代码:

import puppeteer from 'puppeteer';
import useProxy from 'puppeteer-page-proxy';

let options = {
    headless: false,
    devtools: true,
};
const browser = await puppeteer.launch(options);
const page = await browser.newPage();

await useProxy(page, 'socks5://127.0.0.1:9150');
await page.goto('https://api.ipify.org/');
var result = await page.content();
console.log(result);

错误:

C:\>node test_proxy.mjs
(node:15152) [DEP0123] DeprecationWarning: Setting the TLS ServerName to an IP address is not permitted by RFC 6066. This will be ignored in a future version.
(Use `node --trace-deprecation ...` to show where the warning was created)
C:\node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:156
                    ? new Error(`${response.errorText} at ${url}`)
                      ^

Error: net::ERR_FAILED at https://api.ipify.org/
    at navigate (C:\node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:156:23)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async FrameManager.navigateFrame (C:\node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:131:21)
    at async Frame.goto (C:\node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:512:16)
    at async Page.goto (C:\node_modules\puppeteer\lib\cjs\puppeteer\common\Page.js:1167:16)
    at async file:///C:/test_proxy.mjs:38:2

Node.js v17.2.0

C:\>node --trace-deprecation test_proxy.mjs
(node:5776) [DEP0123] DeprecationWarning: Setting the TLS ServerName to an IP address is not permitted by RFC 6066. This will be ignored in a future version.
    at Object.connect (node:_tls_wrap:1669:15)
    at SocksProxyAgent.<anonymous> (C:\node_modules\puppeteer-page-proxy\node_modules\socks-proxy-agent\dist\agent.js:162:38)
    at Generator.next (<anonymous>)
    at fulfilled (C:\node_modules\puppeteer-page-proxy\node_modules\socks-proxy-agent\dist\agent.js:5:58)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
C:\node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:156
                    ? new Error(`${response.errorText} at ${url}`)
                      ^

Error: net::ERR_FAILED at https://api.ipify.org/
    at navigate (C:\node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:156:23)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async FrameManager.navigateFrame (C:\node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:131:21)
    at async Frame.goto (C:\node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:512:16)
    at async Page.goto (C:\node_modules\puppeteer\lib\cjs\puppeteer\common\Page.js:1167:16)
    at async file:///C:/test_proxy.mjs:38:2

Node.js v17.2.0

如RFC 6066的错误消息中所述,我搜索并找到了以下内容:
htttps://datatracker.ietf.org/doc/doc/doc/html/html/rfc60660666666666666666
但是我不知道那意味着什么。

另外,当我使用等待useproxy时

C:\>node test_proxy.mjs
C:\node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:156
                    ? new Error(`${response.errorText} at ${url}`)
                      ^

Error: net::ERR_FAILED at https://api.ipify.org/
    at navigate (C:\node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:156:23)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async FrameManager.navigateFrame (C:\node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:131:21)
    at async Frame.goto (C:\node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:512:16)
    at async Page.goto (C:\node_modules\puppeteer\lib\cjs\puppeteer\common\Page.js:1167:16)
    at async Timeout._onTimeout (file:///C:/test_proxy.mjs:47:3)

Node.js v17.2.0

I use puppeteer and puppeteer-page-proxy proxy.

I don't have problem with use args: ['--proxy-server=socks5://127.0.0.1:9150',... with either http and https.

I don't have problem with useProxy method and http website.

I just have problem with useProxy method and https website.

Versions:

node v17.2.0
Chromium Version 101.0.4950.0 (Developer Build) (64-bit)
+-- [email protected]
+-- [email protected]

Sample code:

import puppeteer from 'puppeteer';
import useProxy from 'puppeteer-page-proxy';

let options = {
    headless: false,
    devtools: true,
};
const browser = await puppeteer.launch(options);
const page = await browser.newPage();

await useProxy(page, 'socks5://127.0.0.1:9150');
await page.goto('https://api.ipify.org/');
var result = await page.content();
console.log(result);

Errors:

C:\>node test_proxy.mjs
(node:15152) [DEP0123] DeprecationWarning: Setting the TLS ServerName to an IP address is not permitted by RFC 6066. This will be ignored in a future version.
(Use `node --trace-deprecation ...` to show where the warning was created)
C:\node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:156
                    ? new Error(`${response.errorText} at ${url}`)
                      ^

Error: net::ERR_FAILED at https://api.ipify.org/
    at navigate (C:\node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:156:23)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async FrameManager.navigateFrame (C:\node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:131:21)
    at async Frame.goto (C:\node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:512:16)
    at async Page.goto (C:\node_modules\puppeteer\lib\cjs\puppeteer\common\Page.js:1167:16)
    at async file:///C:/test_proxy.mjs:38:2

Node.js v17.2.0

C:\>node --trace-deprecation test_proxy.mjs
(node:5776) [DEP0123] DeprecationWarning: Setting the TLS ServerName to an IP address is not permitted by RFC 6066. This will be ignored in a future version.
    at Object.connect (node:_tls_wrap:1669:15)
    at SocksProxyAgent.<anonymous> (C:\node_modules\puppeteer-page-proxy\node_modules\socks-proxy-agent\dist\agent.js:162:38)
    at Generator.next (<anonymous>)
    at fulfilled (C:\node_modules\puppeteer-page-proxy\node_modules\socks-proxy-agent\dist\agent.js:5:58)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
C:\node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:156
                    ? new Error(`${response.errorText} at ${url}`)
                      ^

Error: net::ERR_FAILED at https://api.ipify.org/
    at navigate (C:\node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:156:23)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async FrameManager.navigateFrame (C:\node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:131:21)
    at async Frame.goto (C:\node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:512:16)
    at async Page.goto (C:\node_modules\puppeteer\lib\cjs\puppeteer\common\Page.js:1167:16)
    at async file:///C:/test_proxy.mjs:38:2

Node.js v17.2.0

As stated in the error message about RFC 6066, I searched and found this:
https://datatracker.ietf.org/doc/html/rfc6066
But I do not know exactly what that means.

Also when I used await useProxy(page, 'socks5://localhost:9150'); or domain name, get another error:

C:\>node test_proxy.mjs
C:\node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:156
                    ? new Error(`${response.errorText} at ${url}`)
                      ^

Error: net::ERR_FAILED at https://api.ipify.org/
    at navigate (C:\node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:156:23)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async FrameManager.navigateFrame (C:\node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:131:21)
    at async Frame.goto (C:\node_modules\puppeteer\lib\cjs\puppeteer\common\FrameManager.js:512:16)
    at async Page.goto (C:\node_modules\puppeteer\lib\cjs\puppeteer\common\Page.js:1167:16)
    at async Timeout._onTimeout (file:///C:/test_proxy.mjs:47:3)

Node.js v17.2.0

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文