Skip to content

[Feature] Add Node-side HTTP/HTTPS proxy support with auto-detect and manual override - #624

Draft
Power-Maverick with Copilot wants to merge 4 commits into
devfrom
copilot/feature-allow-http-proxy-setting
Draft

[Feature] Add Node-side HTTP/HTTPS proxy support with auto-detect and manual override#624
Power-Maverick with Copilot wants to merge 4 commits into
devfrom
copilot/feature-allow-http-proxy-setting

Conversation

Copilot AI commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds first-class proxy support for Node-side networking paths (Supabase, Azure Blob downloads, npm/pnpm installs) with system auto-detection, manual override, NO_PROXY handling, custom CA bundle support, and proxy auth challenge flow. BrowserView networking remains unchanged.

Type of change

  • New feature
  • Bug fix
  • Refactor (no functional change)
  • Documentation
  • Chore / maintenance (dependency update, build, config)
  • Test addition / improvement

Changes

  • Proxy core (src/main/managers/proxyManager.ts)

    • Added centralized proxy resolution with precedence: manualauto (Electron resolveProxy) → none.
    • Added shared proxy agent creation for HTTP/HTTPS clients, including NO_PROXY bypass and optional custom CA bundle merge with tls.rootCertificates.
    • Added startup-time environment export (HTTP_PROXY, HTTPS_PROXY, NO_PROXY) before networked managers initialize.
    • Added proxy auth challenge handling via app.on("login", ...), prompting only on actual 407-style challenges and storing credentials through existing secure encryption patterns (no plaintext persistence).
  • Settings model + persistence

    • Extended user settings with proxy block:
      • mode: "auto" | "manual" | "none"
      • manualProxyUrl?: string
      • noProxyList?: string[]
      • caBundlePath?: string
    • Wired defaults and get/set/update behavior through SettingsManager following existing settings conventions.
  • Settings UI (src/renderer/modules/settingsManagement.ts)

    • Added Network / Proxy section with:
      • mode selector
      • manual proxy URL input (manual mode only)
      • NO_PROXY list input (comma-separated)
      • custom CA bundle path picker (manual mode)
      • Test Connection action with inline result status.
    • Integrated into existing load/save/dirty-state flow.
  • Network call-site wiring

    • Updated Supabase client creation and registry/blob fetch/download paths to use proxy-aware agent/config.
    • Updated npm/pnpm debug install spawn env to inherit proxy variables from resolved proxy config.
    • Kept BrowserView/tool web navigation untouched.
  • Docs

    • Added docs/PROXY_TESTING.md with local validation recipes for:
      • manual proxy routing
      • PAC/WPAD auto-detect
      • TLS interception + custom CA bundle
      • proxy authentication challenge
      • NO_PROXY exclusions
      • troubleshooting/log inspection.

Example (resolved proxy application):

const proxy = await proxyManager.getEffectiveProxyConfig();
proxyManager.applyProcessProxyEnv(proxy);

const agent = await proxyManager.getAgentForUrl(registryUrl);
https.get(registryUrl, { agent }, onResponse);

Architecture checklist

Packages (types & validation)

  • Not applicable — no changes to packages/

If you did change a package:

  • @pptb/types (types): type definitions updated and version bumped in packages/types/package.json
  • @pptb/validate (validation): validation rules updated and version bumped in packages/validation/package.json

Code quality

  • pnpm run typecheck passes with 0 errors (warnings are acceptable)
  • pnpm run lint passes with 0 errors (warnings are acceptable)
  • pnpm run build completes successfully

Testing

  • pnpm run test:unit passes (for changes to src/main/, src/common/, or src/renderer/ utilities)
  • pnpm run test:e2e passes (for UI / navigation / end-to-end flows)
  • Manually tested in the running app (pnpm run dev)

Scenario tested:

Proxy mode switching (auto/manual/none), manual proxy routing validation, custom CA bundle path handling, auth challenge prompt flow, and NO_PROXY bypass behavior.

Screenshots / recordings

UI update in Settings: new Network / Proxy section with mode selector, manual URL, NO_PROXY, CA bundle picker, and Test Connection status.

Breaking changes

  • No breaking changes
  • Yes — describe impact and migration path below:

Reviewer notes

  • I have added appropriate unit and/or e2e tests for this change
  • I have resolved all GitHub Copilot review comments
  • I have followed the guidelines in CONTRIBUTING.md

Copilot AI linked an issue Aug 8, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add HTTP/HTTPS proxy support for PPTB desktop app [Feature] Add Node-side HTTP/HTTPS proxy support with auto-detect and manual override Aug 8, 2026
Copilot AI requested a review from Power-Maverick August 8, 2026 18:52
Co-authored-by: Power-Maverick <36135520+Power-Maverick@users.noreply.github.com>
Copilot AI and others added 2 commits August 10, 2026 03:24
Co-authored-by: Power-Maverick <36135520+Power-Maverick@users.noreply.github.com>
Co-authored-by: Power-Maverick <36135520+Power-Maverick@users.noreply.github.com>
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.

[Feature]: Allow HTTP Proxy setting

2 participants