Skip to content

New: Add support for PAC URL and windows registry#712

Open
tsvi wants to merge 8 commits intobrafdlog:masterfrom
tsvi:proxy-sup-winreg
Open

New: Add support for PAC URL and windows registry#712
tsvi wants to merge 8 commits intobrafdlog:masterfrom
tsvi:proxy-sup-winreg

Conversation

@tsvi
Copy link
Contributor

@tsvi tsvi commented Jan 13, 2026

After some more usage of the proxy support I discovered a few issues,

  1. Under windows, the information can be set in the registry instead of using an environment variable.
  2. Sometimes the information is provided as a PAC proxy. The URL points basically to a configuration file that defines the location of the proxy.
  3. I tried setting PAC proxy directly and not messing around with parsing it. Unfortunately, pupetter when downloading the browser does not allow changing the proxy agent. This forced me to parse the information from the PAC proxy.
  4. Although I tested the previous PR under Linux working fine for scraping, I had missed getting the information uploaded to YNAB. This PR also updates the Network settings for unidici which is responsible for pushing the information to YNAB.

I changed downloadChromium back to be proxy-agnostic. Setting the proxy is now done at the backend level supporting both scraping and pushing.
I refactored the proxyConfig code to make it clearer in functionality and set it as a directory under backend.

@tsvi tsvi changed the title Add support for PAC URL and windows registry (feat) Add support for PAC URL and windows registry Jan 13, 2026
@tsvi tsvi changed the title (feat) Add support for PAC URL and windows registry New: Add support for PAC URL and windows registry Jan 13, 2026
@baruchiro baruchiro requested a review from Copilot January 22, 2026 05:37
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for Windows registry-based proxy configuration and PAC (Proxy Auto-Config) file parsing to enable the application to work behind corporate proxies. The proxy configuration has been refactored from being import-specific to backend-level, ensuring proxy support for both scraping (via Puppeteer) and YNAB API calls (via undici).

Changes:

  • Added Windows registry proxy detection for Windows environments
  • Implemented PAC file fetching and basic proxy extraction via regex pattern matching
  • Refactored proxy configuration into a dedicated proxyConfig module with separate concerns (agent management, PAC files, Windows registry)
  • Integrated proxy initialization/teardown at the backend level to support both Chromium downloads, scraping, and YNAB API communication

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 16 comments.

Show a summary per file
File Description
yarn.lock Added dependencies for winreg, @types/winreg, and undici
packages/main/src/backend/proxyConfig/windowsRegistry.ts New file implementing Windows registry reading for proxy settings
packages/main/src/backend/proxyConfig/pacFile.ts New file implementing PAC file fetching, caching, and basic proxy extraction
packages/main/src/backend/proxyConfig/index.ts New orchestration module that checks environment variables, Windows registry, and PAC files for proxy configuration
packages/main/src/backend/proxyConfig/agentManager.ts New module managing global HTTP/HTTPS agents and undici dispatcher configuration
packages/main/src/backend/index.ts Integration of proxy initialization at scrape start and teardown at completion
packages/main/src/backend/import/downloadChromium.ts Removed proxy-specific initialization/teardown (now handled at backend level)
packages/main/src/backend/import/bankScraper.ts Updated import path from local to backend-level proxyConfig
packages/main/src/backend/import/proxyConfig.ts Deleted old proxy configuration implementation
package.json Added winreg, @types/winreg, and undici dependencies

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tsvi tsvi force-pushed the proxy-sup-winreg branch from 395037b to a8c92eb Compare January 22, 2026 13:07
@tsvi tsvi force-pushed the proxy-sup-winreg branch from a612a76 to c802abd Compare January 29, 2026 10:10
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.

1 participant