fix(codex): honor env proxies for WebSockets - #83
Merged
raine merged 2 commits intoJul 29, 2026
Conversation
Route Codex WebSocket upgrades through standard proxy environment semantics, including HTTP(S), SOCKS, NO_PROXY, and CGI protection. Preserve native and WebPKI trust roots, robustly handle CONNECT responses, and prevent undeclared direct fallback. Harden handshake validation and credential redaction with local proxy coverage and portable documentation.
Loading platform certificates for every reqwest client made Codex provider construction exceed the existing streaming startup deadline on macOS. The native-roots reqwest feature also changed trust policy and initialization cost for unrelated providers. Keep reqwest's bundled public roots as the crate-wide default. Build one shared Codex WebSocket TLS configuration from platform and public roots, then use that configuration for both reqwest WebSocket upgrades and explicit CONNECT tunnels. Report native certificate loading and parsing failures by count. This preserves enterprise proxy trust without repeated platform store scans or cross-provider TLS changes. There are no breaking configuration changes.
raine
force-pushed
the
fix/codex-websocket-env-proxy-pr
branch
from
July 29, 2026 09:17
7563e3e to
30267d3
Compare
Owner
|
Thanks |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Codex HTTP requests already honor standard proxy environment variables, but WebSocket connections were opened directly. This meant the default WSS transport could require OS-level TUN routing even when an HTTP or SOCKS proxy was configured.
This change adds explicit environment-proxy support for Codex WebSocket setup:
HTTP_PROXYforws://andHTTPS_PROXYforwss://ALL_PROXYfallback andNO_PROXYbypassIt also:
Testing
cargo fmt --all -- --checkcargo check --lockedcargo test --lockedsuite with loopbackNO_PROXYisolationThe full test suite passed, including 9 Codex WebSocket proxy integration tests and the existing pooling, continuation, authentication, retry, and smoke-cutover coverage.
Not run: Astro documentation build, because the documentation dependencies were not installed.
🤖 Generated with Claude Code