Skip to content

fix: tunnel HTTP/2 Run sessions through HTTPS_PROXY CONNECT - #27

Merged
oakimov merged 2 commits into
mainfrom
fix/http2-https-proxy-connect
Sep 25, 2026
Merged

oakimov merged 2 commits into
mainfrom
fix/http2-https-proxy-connect

Conversation

@oakimov

@oakimov oakimov commented Sep 24, 2026

Copy link
Copy Markdown
Owner

Summary

Test plan

  • bun test test/https-proxy.test.ts test/connect-origin.test.ts
  • bun run typecheck
  • @ThomasFeher — if you can, please re-test on your proxied network (HTTPS_PROXY=http://…, direct 443 blocked): confirm GetServerConfig / models still work and a real cursor/* Run completes instead of the 15s http2.connect timeout. A note with OpenCode/provider versions and whether auth/NO_PROXY behave as expected would help a lot — thanks again for the clear repro and Bun-safe CONNECT recipe.

Unary fetch already honored proxy env; node:http2 did not. Open a
CONNECT tunnel on a native socket, then TLS+ALPN h2, so Runs work
behind HTTP proxies without the Bun Duplex segfault path.
Build proxy auth before dialing and keep undecodable userinfo verbatim,
close the tunnel when TLS setup throws, ignore non-http proxy URLs and
HTTP_PROXY for HTTPS, match port-qualified NO_PROXY against the dialed
port, accept any 2xx CONNECT reply, stop retrying 403/407, and dial
IPv6 proxy literals without brackets.
@oakimov
oakimov merged commit a729bb4 into main Sep 25, 2026
3 checks passed
@oakimov
oakimov deleted the fix/http2-https-proxy-connect branch September 25, 2026 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HTTP/2 Run stream ignores HTTPS_PROXY / NO_PROXY (connect timeout behind an HTTP proxy)

1 participant