ChatGPT.app on macOS ignores system proxy / launchctl env / .env — only --proxy-server flag works
Environment
| Item | Detail |
|------|--------|
| macOS | 27.0 (Build 26A5378n, arm64) |
| ChatGPT.app | 26.715.72359 (Build 5718) |
| Codex CLI | 0.145.0-alpha.30 |
| Proxy | HTTP 127.0.0.1:10808 (v2rayN with xray mixed inbound + sing-box TUN) |
Problem
ChatGPT.app GUI consistently fails with net::ERR_PROXY_CONNECTION_FAILED for every API call (/wham/accounts/check, /wham/usage, /wham/tasks/list, /conversations, etc.) when launched by clicking the app icon (Finder/Dock).
Meanwhile, the bundled CLI (codex doctor) works fine with proxy env vars — WebSocket connects (HTTP 101), API reachable.
What I've tried
| Method | Result |
|--------|--------|
| System proxy via networksetup (HTTP + HTTPS) | ❌ ERR_PROXY_CONNECTION_FAILED |
| System proxy + SOCKS disabled (HTTP only) | ❌ same error |
| launchctl setenv HTTP_PROXY/HTTPS_PROXY/ALL_PROXY | ❌ same error |
| ~/.codex/.env with http_proxy=http://127.0.0.1:10808 | ❌ same error |
| TUN mode (sing-box, network-level routing) + no system proxy | ❌ same error |
| --proxy-server="http://127.0.0.1:10808" flag | ✅ WORKS |
Root cause
The Electron/Chromium renderer process in the macOS ChatGPT.app does not resolve proxy settings from:
- macOS System Configuration framework (
scutil --proxy/networksetup) launchctlenvironment variables~/.codex/.envfile
It only respects the --proxy-server Chromium command-line flag. But clicking the app icon in Finder/Dock does not pass this flag.
Why this is a problem
In network-restricted environments (e.g., mainland China), users must route traffic through a local HTTP proxy. Every other macOS app respects the system proxy — browsers, terminals, other Electron apps — but ChatGPT.app does not.
The --proxy-server workaround forces users to launch from terminal or create a wrapper .app, which is a poor UX for a consumer desktop application.
This is related to but distinct from #13682 — the .env fix mentioned there works for the CLI/app-server WebSocket, but does not fix the Chromium renderer's HTTP requests.
Log excerpt
sa_server_request_failed errorMessage=net::ERR_PROXY_CONNECTION_FAILED routePattern=/wham/accounts/check
sa_server_request_failed errorMessage=net::ERR_PROXY_CONNECTION_FAILED routePattern=/wham/usage
sa_server_request_failed errorMessage=net::ERR_PROXY_CONNECTION_FAILED routePattern=/wham/tasks/list
sa_server_request_failed errorMessage=net::ERR_PROXY_CONNECTION_FAILED routePattern=/conversations
All requests fail identically.
Suggested fix
Either:
- Have the Electron main process read system proxy settings (via
SCDynamicStoreCopyProxies/system-configon macOS) and pass them to Chromium's proxy resolver at startup - Provide a GUI proxy settings panel in ChatGPT.app preferences that writes to Chromium's proxy config
- Read
HTTP_PROXY/HTTPS_PROXYfrom launchctl or~/.codex/.envand apply them as Chromium proxy rules on app startup
1 Comment
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action