Cuadrix / puppeteer-page-proxy

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Page not found?

LeM0-Dev opened this issue · comments

commented

I want to implement puppeteer-page-proxy into my code, which should allow me dynamically change used proxy.

let args = ["--no-sandbox"];
let browser = await p.launch({headless: false, args});
let page = await browser.newPage();
await page.setUserAgent('Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36');
	
await page.setRequestInterception(true);
page.on('request', async request => {
    await useProxy(request, `https://${proxyAsg[product].main[browserPageAsg[product].proxyRotation]}`);
});

When creating new page I set the event listener for the request and set the proxy as per the github docs. But I always get "This site can’t be reached" error. It works fine when I use the proxy via browser args --proxy-server=..... But not through puppeteer-page-proxy. Thanks in advance.

commented

I found the issue. In proxy.js there is a try - catch in requestHandler function. But the error from catch isnt printed while its causing the module not to work properly. Now I am atleast getting an error: RequestError: write EPROTO 37016:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:c:\ws\deps\openssl\openssl\ssl\record\ssl3_record.c:332:
Which atleast gives me an idea where the issue lies