The app keeps reconnecting
Check Was Codex started after the variables were set? Is the address an http:// one?
Fix Quit fully and start it again from the terminal; replace any socks5:// address with the HTTP one.
Set HTTPS_PROXY for the Codex process only, restart it, then check the exit.
| Item | Used for | Notes |
|---|---|---|
| HTTPS_PROXY | HTTPS requests first, then secure WebSocket | The main one to set. Use an http:// address. |
| HTTP_PROXY | Secure WebSocket after HTTPS_PROXY | Set it to the same value. |
| ALL_PROXY | Fallback for both | Optional if the two above are set. |
| NO_PROXY | Hosts that skip the proxy | Use localhost,127.0.0.1. |
Codex source (outbound_proxy.rs), read 13 November 2026. The same code marks socks, socks4 and socks5 addresses as unsupported.
A variable only reaches the program that is started with it. The browser, the package manager and every other app keep using your normal connection. That is the whole point: the proxy belongs to Codex, not to the computer.
The Codex source says that, when system proxy discovery is switched on, it is tried first and the environment variables are the fallback. If you have no system proxy configured, the variables are what counts.
export HTTPS_PROXY="http://LOGIN:PASSWORD@HOST:2222"
export HTTP_PROXY="$HTTPS_PROXY"
export NO_PROXY="localhost,127.0.0.1"
# Quit the app first, then start it from this same terminal window
open -a "APP NAME" --env HTTPS_PROXY --env HTTP_PROXY --env NO_PROXYExample only. Replace LOGIN, PASSWORD and HOST with the values from My assets, and APP NAME with the app's name in your Applications folder.
An app opened from the Dock or Finder does not read the variables you exported in a terminal. The macOS open command has an --env option that adds a variable to the environment of the application it launches, so open is a clean way to start Codex with the proxy and without touching the rest of the system.
If the app is already running, quit it fully first. A running app keeps the environment it started with.
setx HTTPS_PROXY "http://LOGIN:PASSWORD@HOST:2222"
setx HTTP_PROXY "http://LOGIN:PASSWORD@HOST:2222"
setx NO_PROXY "localhost,127.0.0.1"Example only. Replace LOGIN, PASSWORD and HOST. These are user variables, so every program you start afterwards can see them.
setx writes the variables to the registry. They are available in programs started afterwards, not in windows that are already open, so close Codex fully (check the system tray and Task Manager) and open it again. If it still does not see them, sign out of Windows and in again.
The variables apply to every program you start from then on, but only Codex and tools that read the same variables will use them. To remove them later, delete the three variables in the system environment settings.
The extension runs inside VS Code, and VS Code passes its own environment to the processes it starts. So set the variables before VS Code starts: on macOS and Linux run code . from a terminal where they are exported, on Windows use setx and restart VS Code.
If the variables are set after VS Code is open, quit VS Code fully and open it again.
Codex does not accept socks5 addresses. A static IP on Proxy302 is issued with one protocol, and a per-IP lease also connects over the other protocol on that protocol's port, so the simple fix is the HTTP address on port 2222 with the same login.
If you want to keep the SOCKS5 address, run a local forwarder on your own computer and give Codex its http://127.0.0.1 address. The guide below has the commands.
gost -L http://127.0.0.1:8080 -F socks5://LOGIN:PASSWORD@HOST:3333
# then, in the terminal or variables that start Codex:
HTTPS_PROXY=http://127.0.0.1:8080Example only. Keep the forwarder on 127.0.0.1 and replace HOST, LOGIN and PASSWORD.
Buy a static ISP IP with the HTTP protocol, in the country that matches your account. Open My assets and copy host, port, username and password.
Put them in HTTPS_PROXY as http://LOGIN:PASSWORD@HOST:2222. If the password has @ or :, percent-encode them (@ becomes %40).
Quit Codex completely and start it with the variables, as in the macOS or Windows section above.
Run the check below in the same terminal. The country should be the one you bought.
Expected result ipinfo.io shows the proxy's IP, not yours.
curl -x "$HTTPS_PROXY" https://ipinfo.io/jsonExample only. It proves the proxy address and login work; then watch whether Codex stops reconnecting.
A proxy changes the network address a service sees. It does not change which countries OpenAI supports, and OpenAI's page on supported countries says that accessing the services outside the listed countries and territories may result in the account being blocked or suspended. Use an IP in a country on that list, matching where you really are.
Check Was Codex started after the variables were set? Is the address an http:// one?
Fix Quit fully and start it again from the terminal; replace any socks5:// address with the HTTP one.
Check The username or password is wrong, or has special characters.
Fix Copy them again from My assets and percent-encode @ and : in the URL.
Check The app may have been started before the variables existed.
Fix Close every Codex window and process, then start it again with the variables.
Stop when If curl also fails, the problem is the IP or lease. Send the order number to Support.
Its source reads proxy variables from the environment, so that is the method this page uses.
No. The Codex source marks socks, socks4 and socks5 addresses as unsupported; use an HTTP address.
Only programs started with them, and only those that read proxy variables. Your browser and other apps are not changed.
A running program keeps the environment it started with, so variables set later are not picked up.
A static ISP IP with the HTTP protocol: it stays the same during the lease. Choose the country that matches your account.
Official documentation · Confirmed on:
Read on 13 November 2026 (main branch): HTTPS requests use HTTPS_PROXY, then ALL_PROXY; secure WebSocket uses HTTPS_PROXY, HTTP_PROXY, then ALL_PROXY; NO_PROXY is read; socks, socks4 and socks5 schemes are marked unsupported; the file header says system proxy discovery is tried first when enabled and environment variables are the fallback.
Local example · Confirmed on:
Read on 13 November 2026: open --env NAME=VALUE adds a variable to the environment of the launched application.
Official documentation · Confirmed on:
Read on 13 November 2026: setx writes variables to the registry; they are available in future command windows only, not the current one.
Official documentation · Confirmed on:
Read on 13 November 2026: accessing or offering access to the services outside the listed countries and territories may result in the account being blocked or suspended.
Official documentation · Confirmed on:
Read on 13 November 2026: -L sets the local listener and -F the next hop; credentials go in the URL as user:pass@.
Product observation · Confirmed on:
Product facts file of the site, checked 10 November 2026: HTTP port 2222 and SOCKS5 port 3333 on proxy.proxy302.com; each static IP is issued with one protocol; a per-IP lease also connects over the other protocol on that protocol's port; lease terms and prices.
Create an account, top up once, then pick rotating residential, static ISP or datacenter IPs and have one running in your browser within minutes.