Skip to content

Enable websocket on wasm#476

Draft
peter-jerry-ye wants to merge 1 commit into
mainfrom
codex/wasm-websocket-support
Draft

Enable websocket on wasm#476
peter-jerry-ye wants to merge 1 commit into
mainfrom
codex/wasm-websocket-support

Conversation

@peter-jerry-ye

@peter-jerry-ye peter-jerry-ye commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Why

WebSocket was still native-only even though the HTTP/TLS stack now has wasm support. That kept wasm users from using the existing WebSocket client/server implementation and left the websocket test matrix behind native.

Correctness

This enables the existing websocket implementation, docs, and non-process tests for wasm. The accept-key path no longer depends on TLS crypto helpers: Sec-WebSocket-Accept is computed with package-local SHA-1 plus the existing base64 encoder, covered by the RFC accept-key test.

For WebSocket nonce and frame-mask bytes, native uses a websocket-local CSPRNG stub. Wasm does not add a new host import; it seeds a package-local ChaCha8 generator from the existing async clock import, so the wasm backend remains within the current moonrun host contract.

Scope

The change is limited to websocket target metadata, websocket-local crypto/random helpers, and shared websocket tests/docs. external_client_test.mbt remains native-only because it shells out through process APIs, which are intentionally outside this PR.

@peter-jerry-ye peter-jerry-ye force-pushed the codex/wasm-websocket-support branch from 104a892 to 54f8f20 Compare July 3, 2026 08:34
@coveralls

coveralls commented Jul 3, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 736

Coverage remained the same at 76.987%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 2 coverage regressions across 1 file.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

2 previously-covered lines in 1 file lost coverage.

File Lines Losing Coverage Coverage
src/http/client.mbt 2 79.63%

Coverage Stats

Coverage Status
Relevant Lines: 4667
Covered Lines: 3593
Line Coverage: 76.99%
Coverage Strength: 72282.66 hits per line

💛 - Coveralls

@peter-jerry-ye peter-jerry-ye marked this pull request as ready for review July 3, 2026 08:35
@peter-jerry-ye peter-jerry-ye marked this pull request as draft July 3, 2026 08:35
@peter-jerry-ye peter-jerry-ye force-pushed the codex/wasm-websocket-support branch 2 times, most recently from ca8bce3 to 4468997 Compare July 3, 2026 08:54
@peter-jerry-ye peter-jerry-ye force-pushed the codex/wasm-websocket-support branch from 4468997 to 5de792e Compare July 3, 2026 08:55
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.

2 participants