You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(desktop): add HTTP proxy setting in advanced preferences (#350)
## Summary
- Adds a new `proxyUrl` preference in Settings → Advanced. The URL is
applied to Chromium's network stack (`session.defaultSession.setProxy`)
and to Node's `HTTP_PROXY` /
`HTTPS_PROXY` env vars, so both renderer fetches and main-process
outbound traffic (LLM APIs, update feed) route through the configured
proxy.
- Applied immediately on save and at boot — no restart needed. Empty
string disables the proxy.
- Persisted in `~/.config/open-codesign/preferences.json` under a bumped
`schemaVersion` (8 → 9). Defaults to `''`, so existing installs are
unaffected.
- i18n strings added for en / es / pt-BR / zh-CN.
## Four principles
- **Compatibility** ✅ — additive field, defaults to empty, older
preferences upgrade cleanly via the existing migration path.
- **Upgradeability** ✅ — `schemaVersion` bumped to 9;
`parsePersistedFile` ignores unknown keys from stale builds.
- **No bloat** ✅ — no new dependencies; uses only `electron.session` and
Node env vars already in the runtime.
- **Elegance** ✅ — single `applyProxyConfig(url)` helper, commit-on-blur
input so we don't thrash the file/proxy on every keystroke.
## Test plan
- [x] `pnpm lint`
- [x] `pnpm typecheck`
- [x] `pnpm test` (1837 tests across workspace — all green; new vitest
cases cover proxy round-trip, env-var clear, whitespace trimming, and
rejection of non-string
`proxyUrl`)
- [ ] Manual: set proxy in Settings → Advanced, confirm LLM request
routes through it, then clear and confirm direct connection resumes —
all without restart
## Notes
Reference: maintainer green-light on the proxy-settings discussion.
Changeset included (`.changeset/proxy-settings.md`):
`@open-codesign/desktop` minor, `@open-codesign/i18n`
patch.
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Add an HTTP proxy field to Settings → Advanced. The configured URL is applied to both Chromium's network stack and Node's HTTP(S)_PROXY env vars, takes effect immediately, and persists across restarts.
Copy file name to clipboardExpand all lines: packages/i18n/src/locales/en.json
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -640,6 +640,8 @@
640
640
"timeout": "Generation timeout",
641
641
"timeoutHint": "Seconds before a generation request is aborted.",
642
642
"timeoutSeconds": "{{value}} s",
643
+
"proxy": "HTTP proxy",
644
+
"proxyHint": "Route outbound network and LLM API requests through this proxy (e.g., http://127.0.0.1:7890). Leave blank to disable. Applied immediately — no restart needed.",
643
645
"devtools": "Developer tools",
644
646
"devtoolsHint": "Open the Chromium DevTools panel for the renderer.",
0 commit comments