Created
March 7, 2026 04:49
-
-
Save Loongphy/7b4d201a805d3be1f61bd19995c16b7f to your computer and use it in GitHub Desktop.
fix reconnecting issues for Codex Windows App by forcibly injecting proxy environment variables
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pwsh.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -Command '& { | |
| $env:HTTP_PROXY="http://127.0.0.1:7890" | |
| $env:HTTPS_PROXY="http://127.0.0.1:7890" | |
| $env:ALL_PROXY="socks5://127.0.0.1:7890" | |
| $env:NO_PROXY="localhost,127.0.0.1,::1" | |
| $extra="HTTP_PROXY/u:HTTPS_PROXY/u:ALL_PROXY/u:NO_PROXY/u" | |
| if ([string]::IsNullOrWhiteSpace($env:WSLENV)) { $env:WSLENV=$extra } else | |
| { $env:WSLENV=$env:WSLENV+":"+$extra } | |
| $pkg=Get-AppxPackage OpenAI.Codex | |
| $app=(Get-AppxPackageManifest $pkg).Package.Applications.Application | Select-Object -First 1 | |
| $exe=Join-Path $pkg.InstallLocation $app.Executable | |
| Start-Process -FilePath $exe | |
| }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment