Cuadrix / puppeteer-page-proxy

Additional module to use with 'puppeteer' for setting proxies per page basis.
426 stars 101 forks source link

I'VE FIXED ALL THE BUGS / ERRORS. #106

Open Pudochu opened 4 months ago

Pudochu commented 4 months ago

I fixed all the bugs on ‘src\core\proxy.js’.

Here: https://github.com/Pudochu/puppeteer-page-proxy/commit/30bfe18b08d4c96ef62983e8a61c2e731b815bc1

If you encounter some bugs, let me know here - I will fix them.

poolkoleg commented 4 months ago

Load page... Unhandled Rejection at: TypeError: No proxy handler found for target type: CdpHTTPRequest at useProxy (/root/Twitch/node_modules/puppeteer-page-proxy/src/core/proxy.js:87:19) at /root/Twitch/start.js:266:9 at /root/Twitch/node_modules/puppeteer-core/lib/cjs/puppeteer/api/Page.js:238:32 at async CdpHTTPRequest.finalizeInterceptions (/root/Twitch/node_modules/puppeteer-core/lib/cjs/puppeteer/api/HTTPRequest.js:147:9)

If you encounter some bugs, let me know here - I will fix them.

Pudochu commented 4 months ago

Load page... Unhandled Rejection at: TypeError: No proxy handler found for target type: CdpHTTPRequest at useProxy (/root/Twitch/node_modules/puppeteer-page-proxy/src/core/proxy.js:87:19) at /root/Twitch/start.js:266:9 at /root/Twitch/node_modules/puppeteer-core/lib/cjs/puppeteer/api/Page.js:238:32 at async CdpHTTPRequest.finalizeInterceptions (/root/Twitch/node_modules/puppeteer-core/lib/cjs/puppeteer/api/HTTPRequest.js:147:9)

If you encounter some bugs, let me know here - I will fix them.

use : npm i @lem0-packages/puppeteer-page-proxy

const puppeteer = require('puppeteer');
const useProxy = require("@lem0-packages/puppeteer-page-proxy");
(async () => {
  const browser = await puppeteer.launch({
    headless: false,
  });

  const page = await browser.newPage();

  await page.setRequestInterception(true);
  page.on('request', async (request) => {
      await useProxy(request, 'http://TYPE_YOUR@PROXY_HERE:8000');
  });

  await page.goto('https://ipinfo.io');
})();