explaingit

mrwynn/codex-proxy-launcher

15PowerShellAudience · developerComplexity · 2/5Setup · easy

TLDR

Two small launcher scripts (macOS and Windows) that start OpenAI's Codex Desktop with proxy settings injected, so both regular and WebSocket traffic route through a local proxy like Clash.

Mindmap

mindmap
  root((repo))
    Platform Scripts
      macOS shell script
      Windows PowerShell
    Proxy Support
      HTTP proxy
      WebSocket proxy
      Clash port 7890
    Script Commands
      start stop restart
      status log
    Configuration
      Env var overrides
      Custom proxy port
    Windows Quirks
      Store app path fix
      Execution policy
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Run OpenAI Codex Desktop through a local proxy so WebSocket connections don't bypass your network settings.

USE CASE 2

Use Codex in regions where direct overseas internet access is unreliable by routing all traffic through Clash.

USE CASE 3

Quickly restart or check the status of a proxy-wrapped Codex session from the command line.

Tech stack

PowerShellShell ScriptOpenAI Codex DesktopClash Proxy

Getting it running

Difficulty · easy Time to first run · 5min

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).

No license mentioned in the explanation.

In plain English

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.

Copy-paste prompts

Prompt 1
I want to run OpenAI Codex Desktop through a local Clash proxy on macOS. Show me how to set up and use the mrwynn/codex-proxy-launcher shell script, including how to change the default port.
Prompt 2
Explain how the Windows PowerShell launcher in mrwynn/codex-proxy-launcher routes WebSocket traffic through a proxy, and how I fix the PowerShell script execution policy to run it.
Prompt 3
Walk me through using mrwynn/codex-proxy-launcher to start, stop, and check the status of Codex on Windows, and explain the Microsoft Store path workaround.
Prompt 4
How do I override the default proxy host and port in mrwynn/codex-proxy-launcher using environment variables before running the script?
Open on GitHub → Explain another repo

← mrwynn on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.