【发布时间】:2017-10-07 17:00:50
【问题描述】:
在使用 Node.js 中的灯塔 chrome 启动器时,任何人都可以帮我设置无头 chrome 的代理服务器,如提到的 here
const launcher = new ChromeLauncher({
port: 9222,
autoSelectChrome: true, // False to manually select which Chrome install.
additionalFlags: [
'--window-size=412,732',
'--disable-gpu',
'--proxy-server="IP:PORT"',
headless ? '--headless' : ''
]
});
但是,上面的脚本根本没有访问我的代理服务器。 Chrome 似乎回退到 DIRECT:// 连接到目标网站。
另一个关于在无头 chrome 上下文中使用 HTTP/HTTPS 代理服务器的资源是 this。但它没有给出如何从 Node.js 使用它的任何示例。
【问题讨论】:
标签: node.js google-chrome google-chrome-devtools headless-browser lighthouse