Files
tunnler/client/scripts/codex.ps1
T
2026-10-22 21:00:05 +02:00

18 lines
578 B
PowerShell

# Startet den Tunnel (falls noetig) und Codex mit Proxy-Variablen nur fuer diesen Aufruf.
# Alle Argumente werden an codex durchgereicht.
. "$PSScriptRoot\common.ps1"
Start-Tunnel
$names = 'HTTPS_PROXY', 'HTTP_PROXY', 'NO_PROXY'
$saved = @{}
foreach ($n in $names) { $saved[$n] = [Environment]::GetEnvironmentVariable($n, 'Process') }
try {
$env:HTTPS_PROXY = $ProxyUrl
$env:HTTP_PROXY = $ProxyUrl
$env:NO_PROXY = 'localhost,127.0.0.1'
& codex @args
} finally {
foreach ($n in $names) { [Environment]::SetEnvironmentVariable($n, $saved[$n], 'Process') }
}