Run OpenAI Codex Desktop through a local proxy so WebSocket connections don't bypass your network settings.
Use Codex in regions where direct overseas internet access is unreliable by routing all traffic through Clash.
Quickly restart or check the status of a proxy-wrapped Codex session from the command line.
macOS: copy script to a folder on your PATH. Windows: run from PowerShell, may need to adjust script execution policy. Default proxy port is 7890 (Clash).
This repository contains two small launcher scripts, one for macOS and one for Windows, that start OpenAI's Codex Desktop app with proxy network settings injected directly into the app's environment. The scripts exist to solve a specific networking problem: Codex can usually route normal web requests through a system proxy, but WebSocket connections (a type of persistent connection used for streaming responses) often bypass the system proxy settings. By launching Codex through these scripts, both regular and WebSocket traffic get routed through the local proxy. The target use case is running Codex in environments where internet access goes through a local proxy tool, a setup common in regions where direct access to overseas services is unreliable. The scripts are preconfigured to point to port 7890 on localhost, which is the default port for the Clash proxy application, but you can override these values with environment variables before running the script. On macOS, the script is a shell script that supports start, stop, restart, status, and log commands. On Windows, the equivalent is a PowerShell script with the same set of commands. The Windows version also handles a quirk with the Microsoft Store build of Codex, which cannot be launched directly from its installation folder due to Windows permissions, so the script launches it through a different system path instead. Both scripts work by closing any running Codex process first, then relaunching it with the proxy addresses set as named environment variables that both the app and any processes it spawns will inherit. Setup on macOS involves copying the script into a folder on your PATH. On Windows you run it from PowerShell, though you may need to adjust the PowerShell script execution policy first.
← mrwynn on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.