Skip to content

Use Puppeteer browser context for proxy routing - #522

Open
erickguan wants to merge 1 commit into
claabs:masterfrom
erickguan:proxy
Open

Use Puppeteer browser context for proxy routing#522
erickguan wants to merge 1 commit into
claabs:masterfrom
erickguan:proxy

Conversation

@erickguan

Copy link
Copy Markdown
Contributor

Allows proxy in browser to visit epicgames.

@claabs

claabs commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Do the proxy environment variables natively supported by puppeteer not already work?

https://pptr.dev/browsers-api#proxies

@erickguan

Copy link
Copy Markdown
Contributor Author

The documentation is a bit vague. Puppeteer uses proxy for downloading browser. After launching Chrome, for a Chrome browser context, we need to forward config settings to force Chrome using web proxy.

Comment thread src/common/puppeteer.ts
const browserProxy = getBrowserProxyConfig();
const contextOptions: BrowserContextOptions | undefined = browserProxy
? {
proxyServer: browserProxy.rules,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread src/common/puppeteer.ts
executablePath: await executablePath(),
headless: true,
protocolTimeout: 0, // https://github.com/puppeteer/puppeteer/issues/9927
args: [

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't want to inject into CDP, we could also launch browser with proxy. https://github.com/puppeteer/puppeteer/blob/06442aeb8b03fb9effb32bd261a9bffa0b45603a/examples/proxy.js#L10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants