Skip to content

Implement HTTP/1.1 WebSocket Upgrade to HTTP/2 origins (RFC 8441) - #970

Merged
justcoding121 merged 4 commits into
developfrom
feature/h1-ws-to-h2-rfc8441
Aug 2, 2026
Merged

Implement HTTP/1.1 WebSocket Upgrade to HTTP/2 origins (RFC 8441)#970
justcoding121 merged 4 commits into
developfrom
feature/h1-ws-to-h2-rfc8441

Conversation

@justcoding121

Copy link
Copy Markdown
Owner

Summary

  • Implements HTTP/1.1 Upgrade: websocket → HTTP/2 origin via RFC 8441 extended CONNECT on the H1→H2 translation bridge (Http11ToHttp2BridgeHandler), gated by EnableRfc8441.
  • Exposes the leased h2 stream as Http2TunnelStream so existing WebSocket relay (TcpHelper.SendRaw / WebSocketInterceptRelay) is reused; falls back to a dedicated HTTP/1.1 origin when the h2 origin lacks SETTINGS_ENABLE_CONNECT_PROTOCOL.
  • Default EnableRfc8441=false keeps the historical synthetic 501; docs and integration tests cover disabled, tunnel, and fallback paths.

Test plan

  • dotnet build src/Titanium.Web.Proxy.sln / library build with --warnaserror
  • dotnet test filter FullyQualifiedName~Rfc8441H11ToH2TunnelTests (3/3 passed)
  • CI dotnetcore.yml green on this PR
  • Spot-check: forced UpstreamHttpProtocol.Http2 + translation + browser/H1 WebSocket client against an h2 origin with and without ENABLE_CONNECT_PROTOCOL

Bridge Upgrade requests on the H1→H2 translation path into extended CONNECT when EnableRfc8441 is on, fall back to a dedicated HTTP/1.1 origin when the setting is absent, and keep the historical 501 when the feature is off.

Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor

cursor Bot commented Aug 2, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

justcoding121 and others added 3 commits August 2, 2026 04:54
Isolate RFC 6455 SHA-1 Accept computation, reduce cognitive complexity, and add unit coverage for the tunnel stream and handshake helper.

Co-authored-by: Cursor <cursoragent@cursor.com>
…elTests.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add unit and integration tests for tunnel stream edges, ENABLE_CONNECT_PROTOCOL validation, missing keys, origin rejections, and BeforeResponse denial; keep client-facing responses on HTTP/1.1.

Co-authored-by: Cursor <cursoragent@cursor.com>
@sonarqubecloud

sonarqubecloud Bot commented Aug 2, 2026

Copy link
Copy Markdown

@justcoding121
justcoding121 merged commit 5c1fc03 into develop Aug 2, 2026
3 checks passed
justcoding121 added a commit that referenced this pull request Aug 2, 2026
Implement HTTP/1.1 WebSocket Upgrade to HTTP/2 origins (RFC 8441)
@justcoding121
justcoding121 deleted the feature/h1-ws-to-h2-rfc8441 branch August 2, 2026 17:46
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.

1 participant