Windows: ChatGPT-login Codex App and Codex CLI are unstable with SOCKS5 proxy, but recover when switched to HTTP_PROXY/HTTPS_PROXY
Summary
On Windows, both Codex App and Codex CLI appear to be unreliable when outbound traffic goes through a local SOCKS5 proxy.
In my setup, both products showed failures on ChatGPT backend routes such as:
https://chatgpt.com/backend-api/codex/responses/compacthttps://chatgpt.com/backend-api/codex/responseshttps://chatgpt.com/backend-api/plugins/listhttps://chatgpt.com/backend-api//connectors/directory/list?external_logos=true
After switching the same local proxy stack from SOCKS5 env vars to explicit HTTP proxy env vars, the same setup started working.
This makes it look like SOCKS5 support is incomplete or inconsistent for some Codex network paths, especially ChatGPT backend / websocket / streaming / compact-related requests.
Versions
- Codex CLI:
0.122.0 - Codex App:
26.429.3425.0 - Platform: Windows 11 x64
- Login mode: ChatGPT account
- Model observed in logs:
gpt-5.4
Proxy setup
Failing setup
I originally had:
HTTP_PROXY=socks5://127.0.0.1:1080
HTTPS_PROXY=socks5://127.0.0.1:1080
ALL_PROXY=socks5://127.0.0.1:1080
Windows system proxy was also enabled separately.
The local proxy process was v2ray.exe.
Working setup
After changing to explicit HTTP proxy vars and removing ALL_PROXY, the behavior improved:
HTTP_PROXY=http://127.0.0.1:1081
HTTPS_PROXY=http://127.0.0.1:1081
NO_PROXY=localhost,127.0.0.1,::1,192.*,172.*
Windows system proxy was also set to:
127.0.0.1:1081
What issue are you seeing?
When using the SOCKS5-based setup, both Codex App and Codex CLI would fail with stream / compact related errors.
User-visible error:
Error running remote compact task: stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses/compact)
I also found related log lines such as:
failed to send request for url (https://chatgpt.com/backend-api//connectors/directory/list?external_logos=true): client error (Connect): tunnel error: unexpected end of file
startup remote plugin sync failed; will retry on next app-server start error=failed to send remote plugin sync request to https://chatgpt.com/backend-api/plugins/list: error sending request for url (https://chatgpt.com/backend-api/plugins/list)
So this does not seem limited to responses/compact; other chatgpt.com/backend-api/* paths also appear affected.
Steps to reproduce
- On Windows, run a local SOCKS5 proxy.
- Set:
HTTP_PROXY=socks5://127.0.0.1:1080HTTPS_PROXY=socks5://127.0.0.1:1080ALL_PROXY=socks5://127.0.0.1:1080
- Start Codex CLI and/or Codex App using ChatGPT login.
- Use Codex normally until it needs longer-lived backend requests or context compaction.
- Observe stream disconnect / compact failure / backend-api request failures.
- Change the same machine to explicit HTTP proxy env vars:
HTTP_PROXY=http://127.0.0.1:1081HTTPS_PROXY=http://127.0.0.1:1081- unset
ALL_PROXY
- Retry the same workflows.
- Observe that the backend route succeeds under HTTP proxy.
Expected behavior
Codex should work reliably with SOCKS5 proxy configuration as well, or clearly document which network paths currently require explicit HTTP proxy variables.
At minimum, proxy behavior should be consistent across:
- Codex CLI
- Codex App
- websocket / streaming paths
- compact task
- plugin / connector bootstrap paths
Additional notes
This feels related to other proxy / websocket issues already reported, especially around:
- SOCKS-only proxy behavior
chatgpt.com/backend-api/*- websocket vs HTTP transport differences
- app vs CLI proxy inconsistencies
Related issues:
- #9677
- #16360
- #16367
- #14080
- #13682
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗