Skip to content

ws: public client/server fixture receives unexpected HTTP 426 response #10888

Closed

Description

@proggeramlug

Summary

A clean public-entry ws@8.21.1 client/server fixture compiles on current main (47ade47327) but the client fails with:

Error: Unexpected server response: 426

This is the current ws blocker found while re-testing #10797. The issue's original post-handshake Cannot read properties of undefined (reading 'destroy') failure does not reproduce.

Reproduction shape

  1. Install ws@8.21.1.
  2. Add ws to perry.compilePackages.
  3. Import { WebSocketServer, WebSocket } from the public ws entry point.
  4. Start a local WebSocketServer and connect to it with a public WebSocket client.
  5. Compile and run with Perry.

No partial-codegen flag or internal package import is used.

Expected

The local WebSocket upgrade succeeds and the server emits its connection event, as under Node.

Actual

The client reports HTTP 426 instead of completing the WebSocket upgrade.

Provenance

Split from #10797 after re-establishing the package probe through its normal public entry point. See the re-test details.

Activity

  1. added
    package-auditFound by the 2026 package audit: compiling real npm packages from source instead of native bindings
    on Sep 21, 2026
  2. proggeramlug commented on Sep 21, 2026

    @proggeramlug
    ContributorAuthor

    Fixed in v0.5.1633 (merge train 253, 0fa3915293) by #10899 — fix(http): preserve upgrades over custom connections.

    An HTTP upgrade request using a custom createConnection socket lost Connection: Upgrade, so the ws handshake saw an ordinary request and the server answered 426 Upgrade Required. Perry now preserves the upgrade and emits the request's upgrade event.

    Verified by running crates/perry/tests/issue_10888_create_connection_upgrade.rs against the landed tree: 2 passed, 0 failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    package-auditFound by the 2026 package audit: compiling real npm packages from source instead of native bindings

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions