Can’t Connect Your Phone to Codex? The Real Issue Might Be WebSocket and Proxies
If you’ve been trying to connect your phone’s ChatGPT to Codex on your Mac (for remote control or cross‑device workflows) and keep seeing “Unable to update remote status,” this guide will save you hours of guesswork.
I ran into this exact problem today. After a fair amount of frustration, the fix turned out to be straightforward once I knew where to look. Below I’ll walk you through the symptoms, the diagnostic steps, the solution, and a few subtle details that are easy to miss.

1. The Correct Connection Flow (Double‑Check This First)
Before diving into troubleshooting, let’s make sure the basic steps are right. The standard way to connect ChatGPT on your phone to Codex on your Mac is:
-
Open Codex on your Mac. -
Go to Connections → Set up Codex mobile. -
Turn on “Allow discovery and control of this device”. -
In the ChatGPT app on your phone, scan the QR code shown by Codex on your Mac. -
Verify that your phone and Mac are using the same ChatGPT account and are in the same workspace.
In theory, that’s all it takes. But if you’re behind certain network environments (e.g., using a proxy in China), you’ll likely get stuck at step 3 or 4, with the Mac showing “Unable to update remote status” and the phone failing to connect.
2. What the Failure Looks Like
Here’s what happened to me:
-
Codex on my Mac had “Allow discovery and control of this device” turned on. -
The message “Unable to update remote status” appeared and never went away. -
The ChatGPT app on my phone scanned the QR code but never connected. -
The ChatGPT website worked perfectly in my browser — I could log in, chat, everything.
So the network seemed to be working, but Codex’s own remote‑control channel was broken.
3. Run the Diagnostic First
Codex includes a built‑in diagnostic tool that many people don’t know about. Open a terminal on your Mac and run:
/Applications/Codex.app/Contents/Resources/codex doctor
This command checks Codex’s runtime status, network connectivity, proxy settings, and more. In my case, the output included something like:
websocket Responses WebSocket timed out
endpoint wss://chatgpt.com/backend-api/...
The key phrase is WebSocket timed out. That told me the problem wasn’t that Codex itself couldn’t start — it was that Codex couldn’t establish a WebSocket connection to the ChatGPT backend.
A quick explanation: being able to visit chatgpt.com in a browser only proves that regular HTTPS works. Codex’s phone remote control, however, relies on a persistent WebSocket connection to wss://chatgpt.com/backend-api/.... WebSocket traffic, while using the same port (443), is often handled differently by proxies.
4. Why Does the Browser Work but Codex Fails?
This is the most confusing part. Your browser automatically picks up system‑wide proxy settings (from tools like Clash, Surge, V2Ray, etc.). That’s why you can access ChatGPT without issues.
But Codex is a native macOS app. Its internal components — including a local app-server — do not automatically inherit the proxy environment variables you might have set in your terminal or system preferences. In other words:
-
Browser → proxy works ✅ -
Codex app‑server → no proxy environment ❌
The codex doctor output confirmed this: it said “no proxy env vars”. So Codex tried to directly reach the ChatGPT backend’s WebSocket endpoint, and naturally timed out.
5. The Solution (Tested and Working)
The fix is simple: manually inject the proxy environment variables into the environment where Codex runs. Note that this isn’t about setting proxies in your terminal — it’s about setting them for the entire launchctl user environment.
Run the following three commands in your terminal (replace 7897 with the actual port your proxy software uses — common ones are 7897, 1087, 7890, 2017, etc.):
launchctl setenv HTTP_PROXY http://127.0.0.1:7897
launchctl setenv HTTPS_PROXY http://127.0.0.1:7897
launchctl setenv ALL_PROXY socks5h://127.0.0.1:7897
After that, completely quit Codex (not just close the window — use Cmd+Q or verify in Activity Monitor that the process is gone), then reopen Codex.
Now go through the mobile connection flow again. Scan the QR code with your phone’s ChatGPT app. This time the connection should succeed.
How to Confirm It’s Fixed
Run the diagnostic command again:
/Applications/Codex.app/Contents/Resources/codex doctor
If you see something like:
websocket connected (HTTP 101 Switching Protocols)
That means the WebSocket handshake succeeded — the link is now open.
6. Common Pitfalls (Based on Real Experience)
Here are a few traps that can waste your time. Check these before going down rabbit holes.
6.1 Quitting Cursor May Not Help
Some people suspect that the old Codex app‑server bundled with Cursor (the editor) might interfere. I tried quitting Cursor completely, but the problem remained. So don’t spend too much time on that — focus on the proxy setup.
6.2 Browser Access ≠ Codex Connectivity
I’ve said this before, but it’s worth repeating. It’s the single most misunderstood point. Just because you can log into chatgpt.com doesn’t mean Codex’s internal components can reach the same backend.
6.3 WebSocket Is the Real Bottleneck
Regular HTTP only gets you so far. Remote control needs a persistent, bidirectional channel — that’s what WebSocket provides. If the WebSocket handshake times out, the phone will never receive status updates from your Mac, and vice versa.
6.4 Same Account, Same Workspace – Must Match
This sounds obvious, but it’s easy to overlook. You might be logged into a personal account on your phone but a team account on your Mac (or accidentally switched workspaces). Even with perfect network conditions, the connection will fail. Double‑check both sides.
6.5 Team or Enterprise Workspaces May Have an Admin Switch
If you’re using a team or enterprise workspace, the administrator might have disabled Remote Control at the organization level. If your network setup is correct but you still can’t connect, ask your admin to check that permission.
7. Frequently Asked Questions (FAQ)
Q: My proxy port isn’t 7897. How do I find the right one?
A: Check your proxy software’s settings (ClashX, Surge, V2RayU, Shadowsocks, etc.). Look for “HTTP/HTTPS listen port” and “SOCKS5 listen port”. Common values: 7890, 7897, 1087, 1080, 2017. Replace 7897 in the commands with your actual port.
Q: After setting launchctl setenv, do I need to restart my Mac?
A: No. But you must fully quit and relaunch Codex. A simple window close isn’t enough — use Cmd+Q or force quit the process. Then reopen Codex.
Q: I ran the commands, but it still doesn’t work. What next?
A: Check in this order:
-
Confirm the port number is correct. -
Make sure your proxy software is running and accepting local connections. -
Run codex doctoragain and look for “proxy env vars” in the output. -
If no proxy vars appear, try restarting Codex once more. As a last resort, you can also launch Codex from a terminal after manually exporting the variables there.
Q: Do these environment variables affect other apps?
A: launchctl setenv sets variables for the current user’s launchd process, which affects all GUI apps launched afterwards. If that’s not what you want, you can unset them when you’re done (see next question).
Q: How do I undo the proxy environment variables?
A: Run these commands:
launchctl unsetenv HTTP_PROXY
launchctl unsetenv HTTPS_PROXY
launchctl unsetenv ALL_PROXY
Then restart Codex if you still use it without proxies.
Q: Does my phone and Mac need to be on the same Wi‑Fi?
A: Yes, usually they need to be on the same local network. However, the WebSocket connection still goes through ChatGPT’s backend relay servers, so the proxy issue on the Mac side remains relevant even if both devices are on the same Wi‑Fi. Also make sure your Wi‑Fi doesn’t have client isolation enabled.
Q: What if I’m on Windows?
A: This guide is based on macOS, the environment described in the original post. Windows has a different approach (system environment variables or launch parameters). Refer to Codex’s official documentation for Windows.
8. Step‑by‑Step Action Checklist
For convenience, here’s a compact checklist you can follow:
| Step | Action | Notes |
|---|---|---|
| 1 | Find your proxy software’s local port | e.g., ClashX often uses 7890 (HTTP) / 7891 (SOCKS5) |
| 2 | Run the three launchctl setenv commands in terminal |
Replace the port number with yours |
| 3 | Fully quit Codex | Use Cmd+Q or Activity Monitor |
| 4 | Reopen Codex | From Applications or Launchpad |
| 5 | Go to Connections → Set up Codex mobile | Turn on “Allow discovery and control” |
| 6 | Run codex doctor |
Confirm you see “websocket connected” |
| 7 | Scan the QR code with your phone’s ChatGPT app | Ensure same account & workspace |
| 8 | Test remote control | Try a simple action from your phone |
9. Summary & Key Takeaways
When your phone won’t connect to Codex, the issue is rarely Codex itself. It’s almost always about network connectivity — especially if you’re using a proxy. The most direct way to diagnose the problem is to run codex doctor. If you see WebSocket timeout, your suspect is the proxy environment.
The fix is straightforward: inject the proper proxy variables into Codex’s environment using launchctl setenv. Remember to use your actual proxy port.
Also don’t forget the non‑network checks: same account, same workspace, and (if applicable) admin permissions for remote control in team/enterprise workspaces.

I hope this saves you from the same frustration. If you’re still stuck after trying the steps above, run codex doctor again and look closely at the error messages — they’re usually the most reliable clue to what’s really going on.

