Skip to content

Add HTTP proxy setting for internet connections#459

Open
Copilot wants to merge 2 commits intodevfrom
copilot/add-http-proxy-settings
Open

Add HTTP proxy setting for internet connections#459
Copilot wants to merge 2 commits intodevfrom
copilot/add-http-proxy-settings

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 17, 2026

Adds a user-configurable HTTP proxy setting so ToolBox can route all outbound internet traffic through a corporate or custom proxy server.

Changes

Types & persistence

  • UserSettings.httpProxy?: string — new field, defaults to "" (no proxy)
  • SettingsState.httpProxy?: string — tracked for change detection in renderer
  • SettingsManager default: httpProxy: ""

Main process proxy application (src/main/index.ts)

  • applyProxySettings(url) — sets session.defaultSession.setProxy() (Chromium/BrowserViews) and process.env.HTTP_PROXY/HTTPS_PROXY (Node.js fetch, http, https)
  • Applied at startup from persisted setting (condition is !== undefined to correctly handle clearing a proxy back to "")
  • Applied immediately whenever UPDATE_USER_SETTINGS includes an httpProxy change
  • Credentials redacted from log output before writing

UI

  • New Network section in the Settings sidebar with a proxy URL text input
  • Hint text notes plain-text storage and accepted format (******host:port)
  • "HTTP Proxy" entry added to global search SETTINGS_ENTRIES

  • Use a meaningful title for the pull request.
  • Follow the guidelines from the CONTRIBUTING.md.
  • Mention the bug or the feature number the PR will be targeting.
  • Test the change in your own code. (Compile and run)
  • Resolve all GH Copilot comments.
Original prompt

Create a setting to add a http proxy for managing connecting to internet.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: Power-Maverick <36135520+Power-Maverick@users.noreply.github.com>
Copilot AI changed the title [WIP] Add setting to configure HTTP proxy for internet connection Add HTTP proxy setting for internet connections Mar 17, 2026
Copilot AI requested a review from Power-Maverick March 17, 2026 22:16
@Power-Maverick Power-Maverick marked this pull request as ready for review March 18, 2026 02:23
Copilot AI review requested due to automatic review settings March 18, 2026 02:23
@github-actions
Copy link
Copy Markdown

Bundle Size Report 📦

Bundle Size
Main Process 947.29 KB
Renderer JS 476.02 KB
Renderer CSS 87.01 KB
Total 1.47 MB

Bundle Analysis Reports

The detailed bundle analysis reports are available in the workflow artifacts:

  • 📊 Main Process: stats-main.html
  • 📊 Renderer Process: stats-renderer.html

Download the artifacts from the workflow run to view interactive visualizations.


Bundle size tracking is now active! This helps prevent bundle bloat.

Copy link
Copy Markdown
Contributor

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

Adds an application-level HTTP proxy setting to ToolBox, wiring it from the settings UI through persisted user settings and into the Electron main process so proxy configuration can be applied at runtime.

Changes:

  • Introduces httpProxy in shared/renderer settings types and SettingsManager defaults.
  • Adds a “Network / HTTP Proxy” field to the Settings sidebar and exposes it via global settings search.
  • Applies proxy configuration on startup and immediately after settings updates via session.defaultSession.setProxy(...).

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/renderer/types/index.ts Extends renderer settings state with httpProxy.
src/renderer/modules/settingsManagement.ts Loads/saves the HTTP proxy setting from the sidebar UI into user settings updates.
src/renderer/modules/globalSearchManagement.ts Adds “HTTP Proxy” as a searchable settings entry with focus target.
src/renderer/index.html Adds the Network settings section and HTTP proxy input/help text.
src/main/managers/settingsManager.ts Adds httpProxy default to persisted user settings.
src/main/index.ts Applies proxy settings at startup and upon settings updates; adds applyProxySettings.
src/common/types/settings.ts Adds httpProxy to the shared UserSettings interface.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +2438 to +2443
logError(err instanceof Error ? err : new Error(String(err)));
});
// Configure Node.js native network requests (main process fetch, http, https)
process.env.HTTP_PROXY = trimmed;
process.env.HTTPS_PROXY = trimmed;
logInfo(`[Proxy] HTTP proxy configured: ${redacted}`);
// Apply saved proxy settings before any network requests (apply even if empty to clear any env vars)
const savedProxy = this.settingsManager.getSetting("httpProxy");
if (savedProxy !== undefined) {
this.applyProxySettings(savedProxy);
<div class="settings-field">
<label class="setting-label" for="sidebar-http-proxy-input">HTTP Proxy</label>
<input type="text" id="sidebar-http-proxy-input" class="fluent-input" placeholder="http://user:password@host:port" />
<span class="setting-hint">Leave empty for a direct connection. Format: <code>http://user:password@host:port</code>. Credentials are stored in plain text in local settings. Applies to all ToolBox network requests on save.</span>
Comment on lines +389 to +390
<input type="text" id="sidebar-http-proxy-input" class="fluent-input" placeholder="http://user:password@host:port" />
<span class="setting-hint">Leave empty for a direct connection. Format: <code>http://user:password@host:port</code>. Credentials are stored in plain text in local settings. Applies to all ToolBox network requests on save.</span>
@Power-Maverick
Copy link
Copy Markdown
Contributor

the dataverse and rest of the connection are not going through the proxy. Need a real proxy config to test it fully. Will need to create a separate build for this and share it with someone who has proxy configured

@Power-Maverick Power-Maverick added question Further information is requested on hold Due to some technical or functional reason the item is on hold labels Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

on hold Due to some technical or functional reason the item is on hold question Further information is requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants