Skip to content

Commit

Permalink
fix: clear cookies when rotating proxies (#2575)
Browse files Browse the repository at this point in the history
  • Loading branch information
davols authored May 26, 2021
1 parent ebf8b20 commit 8854ce9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/store/lookup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,15 @@ async function lookup(browser: Browser, store: Store) {
await disableBlockerInPage(pageProxy);
}

if (
store.currentProxyIndex !== undefined &&
store.proxyList &&
store.proxyList?.length > 1
) {
const client = await page.target().createCDPSession();
await client.send('Network.clearBrowserCookies');
}

// Must apply backoff before closing the page, e.g. if CloudFlare is
// used to detect bot traffic, it introduces a 5 second page delay
// before redirecting to the next page
Expand Down

0 comments on commit 8854ce9

Please sign in to comment.