Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

puppeteer-page-proxy

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

puppeteer-page-proxy

Additional Node.js module to use with 'puppeteer' for setting proxies per page basis.

  • 1.0.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.6K
decreased by-8.91%
Maintainers
1
Weekly downloads
 
Created
Source

puppeteer-page-proxy

Additional Node.js module to use with 'puppeteer' for setting proxies per page basis.

Uses (http | https | socks)-proxy-agent to achieve the desired results.

This small module consists of a class and a function taken from ppspider.

All credit for the original code goes to the author @xiyuan-fengyu.

Installation

npm i puppeteer-page-proxy

Example

const puppeteer = require('puppeteer');
var useProxy = require('puppeteer-page-proxy');

(async () => {
    let site = 'https://example.com';
    let proxy1 = 'http://host:port';
    let proxy2 = 'https://host:port';
    let proxy3 = 'socks://host:port';

    const browser = await puppeteer.launch({headless: false});

    const page1 = await browser.newPage();
    await useProxy(page1, proxy1);
    await page1.goto(site);

    const page2 = await browser.newPage();
    await useProxy(page2, proxy2);
    await page2.goto(site);

    const page3 = await browser.newPage();
    await useProxy(page3, proxy3);
    await page3.goto(site);
})();

Keywords

FAQs

Package last updated on 28 Dec 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc