Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
puppeteer-page-proxy
Advanced tools
Additional Node.js module to use with 'puppeteer' for setting proxies per page basis.
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.
npm i puppeteer-page-proxy
page
<object> Page object to set a proxy for.proxy
<string> Proxy to use in the current page. Must begin with a protocol e.g. http://, https://, socks://.enableCache
<boolean> Whether to enable caching. Defaults to true
.page
<object> Page object to execute the request on.lookupService
<string> External lookup service to request data from. Fetches data from api.ipify.org
by default.isJSON
<boolean> Whether to JSON.parse the received response. Defaults to true
.timeout
<number|string> Time in milliseconds after which the request times out. Defaults to 30000
ms.const puppeteer = require('puppeteer');
const 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);
})();
const puppeteer = require('puppeteer');
const useProxy = require('puppeteer-page-proxy');
(async () => {
let site = 'https://example.com';
let proxy1 = 'http://host:port';
let proxy2 = 'https://host:port';
const browser = await puppeteer.launch({headless: false});
/**1*/
const page1 = await browser.newPage();
await useProxy(page1, proxy1);
let data = await useProxy.lookup(page1); // Waits until done, "then" continues
console.log(data.ip);
await page1.goto(site);
/**2*/
const page2 = await browser.newPage();
await useProxy(page2, proxy2);
useProxy.lookup(page2).then(data => { // Executes and "comes back" once done
console.log(data.ip);
});
await page2.goto(site);
})();
FAQs
Additional Node.js module to use with 'puppeteer' for setting proxies per page basis.
The npm package puppeteer-page-proxy receives a total of 2,134 weekly downloads. As such, puppeteer-page-proxy popularity was classified as popular.
We found that puppeteer-page-proxy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.