Repository navigation
feat(browser): add proxy configuration option - #20578
illusivejosiah wants to merge 8 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 78eccb71d9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
I think this PR shoud be merged to have stronger proxy power, @illusivejosiah could you update this PR to resovle conflicts? |
c2feacc to
eed19e9
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eed19e9c21
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
7d4f0ad to
4e8fc84
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4e8fc849d6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
4e8fc84 to
b00827a
Compare
|
Rebased onto latest Fix (new commit): When a profile sets its own proxy URL without credentials (e.g. All 50 proxy tests passing. @sebslight this PR supersedes the |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b00827a3d6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 06778c52d0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Non-page targets (workers, service workers) attaching first via Target.setAutoAttach could prematurely resolve the startup readiness promise before any page session had Fetch.enable, racing into a 407. Now only page target attachments signal launch readiness, while Fetch auth is still enabled on all sessions for full coverage.
When a profile specifies its own proxy URL without credentials, don't fall through to global proxy credentials via nullish coalescing. A profile proxy without auth means no auth — not 'use the global creds'.
d70f8dc to
eef6bc5
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eef6bc59d9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@vincentkoc saw you working on #31312 for the CDP proxy bypass. Our PR already handles that (commit |
|
Hello, We are @proxybasehq, and eagerly waiting for this feature to be merged. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
Closing due to inactivity. |
feat(browser): add proxy configuration optionSummary
Adds native proxy support to the browser tool. Users can route all browser traffic through HTTP, HTTPS, or SOCKS5 proxy servers via config.
What changed
Config (
browser.proxy):Authenticated proxies — credentials in the URL are stripped before
--proxy-serverand injected via CDPFetch.authRequired:Per-profile overrides — profile proxy falls back to global when not set.
Files changed (7)
src/config/types.browser.tsproxy?: stringonBrowserConfig+BrowserProfileConfigsrc/config/zod-schema.tsproxy+extraArgsadded to Zod schema (extraArgs was in TS type but missing from schema —.strict()rejected it; required for proxy to pass validation)src/browser/config.tsparseProxyUrl()with scheme validation, credential extraction, port check. Per-profile fallback to global.src/browser/chrome.ts--proxy-serverarg injection +setupCdpProxyAuth()for authenticated proxies via browser-level CDPsrc/browser/config.test.tssrc/browser/chrome.proxy-launch.test.ts--proxy-serverarg injection, credential stripping, profile overridedocs/tools/browser.mdWhy CDP for auth?
Chrome's
--proxy-serversilently ignores inline credentials (user:pass@host). When a proxy returns 407, we intercept it via CDPFetch.authRequiredand respond with the configured credentials. This is the same underlying mechanism Puppeteer uses forpage.authenticate(), extended to the browser level viaTarget.setAutoAttachso it covers all tabs automatically.Testing
pnpm build && pnpm check && pnpm test— all pass--proxy-serverarg injection and credential strippingAI disclosure
pnpm build && pnpm check && pnpm test+ targeted proxy unit/launch tests + manual proxy verification)Closes #8079
Greptile Summary
Adds native proxy support to the browser tool with HTTP, HTTPS, and SOCKS5 protocol support. Proxy credentials are extracted from URLs and injected via CDP's Fetch domain to handle 407 authentication challenges, since Chrome's
--proxy-serverdoesn't support inline credentials. The implementation includes per-profile proxy overrides with proper fallback to global config, comprehensive test coverage for config resolution and launch behavior, and clear documentation with security notes.Key changes:
parseProxyUrl()with scheme validation, credential extraction, and port checkingsetupCdpProxyAuth()that attaches to all page targetsIssue found:
setupCdpProxyAuthlacks error handling and is never cleaned up (see inline comment)Confidence Score: 4/5
Last reviewed commit: 78eccb7