puppeteer-extra-plugin-proxy2
v1.0.0
Published
Add proxy for puppeteer `page`, support `http`, `https`, `socks`. Based on [puppeteer-page-proxy](https://github.com/Cuadrix/puppeteer-page-proxy).
Downloads
34
Maintainers
Readme
puppeteer-extra-plugin-proxy2
Add proxy for puppeteer page
, support http
, https
, socks
. Based on puppeteer-page-proxy.
Install
$ npm i puppeteer-extra-plugin-proxy2 --save
Usage
const puppeteer = require('puppeteer-extra')
const PuppeteerExtraPluginProxy = require('puppeteer-extra-plugin-proxy2')
puppeteer.use(PuppeteerExtraPluginProxy({
proxy: 'socks://4436632fee80:[email protected]:57425',
// proxy: 'http://xznskzdw:[email protected]:8243',
}))
;(async () => {
const browser = await puppeteer.launch({
headless: false
})
const page1 = await browser.newPage()
await page1.goto("https://api.myip.com")
const page2 = await browser.newPage()
await page2.goto("https://api.my-ip.io/ip")
})().catch(console.error)