Skip to content

feat: add proxy configuration support (#335)#1890

Open
EvanYao826 wants to merge 1 commit into
bytedance:mainfrom
EvanYao826:feat/proxy-settings
Open

feat: add proxy configuration support (#335)#1890
EvanYao826 wants to merge 1 commit into
bytedance:mainfrom
EvanYao826:feat/proxy-settings

Conversation

@EvanYao826
Copy link
Copy Markdown

Fixes #335

Summary

Add proxy configuration support so users can set HTTP proxy for all Node.js network requests in the app. This solves the problem where Electron/Node.js requests don't use the system proxy.

Changes

  1. Proxy Service (apps/ui-tars/src/main/services/proxy.ts)

    • Applies proxy settings to Electron's session.defaultSession via setProxy()
    • Sets HTTP_PROXY, HTTPS_PROXY, NO_PROXY environment variables for Node.js HTTP clients
    • Supports three modes: system proxy, custom proxy, and disabled
    • Auto-normalizes proxy URLs (adds http:// if no protocol)
    • Re-applies proxy when settings change
  2. Settings UI (apps/ui-tars/src/renderer/src/components/Settings/category/proxy.tsx)

    • Enable/disable proxy toggle
    • System vs Custom proxy mode selector
    • HTTP Proxy URL, HTTPS Proxy URL (optional), No Proxy bypass list fields
    • Auto-saves on change
  3. Settings Integration

    • Added proxy fields to PresetSchema (Zod validation)
    • Added proxy defaults to DEFAULT_SETTING
    • Integrated proxy service into app startup and settings update flow

How It Works

  • On app startup, proxy settings are loaded from the Electron store and applied to both the Electron session (for Chromium network requests) and Node.js environment variables (for OpenAI SDK, fetch, etc.)
  • Users can choose "System Proxy" (reads OS proxy settings) or "Custom Proxy" (manual URL entry)
  • Settings auto-save and dynamically re-apply when changed

Fixes #335

Add proxy settings support to UI-TARS-desktop so users can configure
HTTP/HTTPS proxy for all Node.js and Electron network requests.

Changes:
- Add proxy fields to settings schema (proxyEnabled, proxyMode, httpProxy,
  httpsProxy, noProxy)
- Create proxy service that applies proxy settings to Electron session
  and Node.js environment variables
- Add 'Proxy Settings' section in the Settings page with:
  - Enable/disable proxy toggle
  - System proxy vs custom proxy mode selection
  - HTTP proxy, HTTPS proxy, and no_proxy configuration fields
- Proxy settings are auto-saved and applied on change via watch
- Proxy is applied on app startup before any network requests
- Watch settings changes to re-apply proxy dynamically

Closes bytedance#335
@netlify
Copy link
Copy Markdown

netlify Bot commented May 12, 2026

Deploy Preview for agent-tars-docs canceled.

Name Link
🔨 Latest commit 4953e1b
🔍 Latest deploy log https://app.netlify.com/projects/agent-tars-docs/deploys/6a02b40c969515000894c73f

@netlify
Copy link
Copy Markdown

netlify Bot commented May 12, 2026

Deploy Preview for tarko canceled.

Name Link
🔨 Latest commit 4953e1b
🔍 Latest deploy log https://app.netlify.com/projects/tarko/deploys/6a02b40cf5f91300086ddd84

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@EvanYao826
Copy link
Copy Markdown
Author

I have already signed the CLA. @CLAassistant please recheck.

1 similar comment
@EvanYao826
Copy link
Copy Markdown
Author

I have already signed the CLA. @CLAassistant please recheck.

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]: 支持设置代理转发端口以解决 Node.js 请求不走系统代理的问题

2 participants