Windows: ChatGPT-login Codex App and Codex CLI are unstable with SOCKS5 proxy, but recover when switched to HTTP_PROXY/HTTPS_PROXY

Open 💬 3 comments Opened May 3, 2026 by AarenWang

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/compact
  • https://chatgpt.com/backend-api/codex/responses
  • https://chatgpt.com/backend-api/plugins/list
  • https://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

  1. On Windows, run a local SOCKS5 proxy.
  2. Set:
  • HTTP_PROXY=socks5://127.0.0.1:1080
  • HTTPS_PROXY=socks5://127.0.0.1:1080
  • ALL_PROXY=socks5://127.0.0.1:1080
  1. Start Codex CLI and/or Codex App using ChatGPT login.
  2. Use Codex normally until it needs longer-lived backend requests or context compaction.
  3. Observe stream disconnect / compact failure / backend-api request failures.
  4. Change the same machine to explicit HTTP proxy env vars:
  • HTTP_PROXY=http://127.0.0.1:1081
  • HTTPS_PROXY=http://127.0.0.1:1081
  • unset ALL_PROXY
  1. Retry the same workflows.
  2. 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

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗