ERROR: DeprecationWarning: Setting the TLS ServerName to an IP address is not permitted by RFC 6066. This will be ignored in a future version.
NabiKAZ opened this issue · comments
I use tor
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
and http
I just have problem with useProxy
and https
Versions:
node v17.2.0
Chromium Version 101.0.4950.0 (Developer Build) (64-bit)
+-- puppeteer-page-proxy@1.2.8
+-- puppeteer@13.6.0
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
When I used await useProxy(page, 'socks5://localhost:9150');
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
We can use resolutions
or overrides
for yarn
and npm
as a temporary solution.
package.json
:
"overrides": {
"socks-proxy-agent": "6.0.0"
},
"resolutions": {
"socks-proxy-agent": "6.0.0"
}
And run yarn install
or npm install
.