Skip to content

Instantly share code, notes, and snippets.

@Loongphy
Created March 7, 2026 04:49
Show Gist options
  • Select an option

  • Save Loongphy/7b4d201a805d3be1f61bd19995c16b7f to your computer and use it in GitHub Desktop.

Select an option

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