Skip to content

Cross-script service bindings drop WebSocket targets #149

Closed

Description

@mohamedalichelbi

Problem

A router Worker calls a backend Worker through a service binding. The backend returns a WebSocket upgrade response.
Celld sends the HTTP response but drops its WebSocket target. The browser closes the connection with code 1006.

Expected result

The router must return the backend WebSocket to the client. The client must connect and exchange messages normally.

Cause

op_svc_call_impl calls:

encode_http_response(response, false)

The false value removes wsTarget from the encoded response.
The JavaScript harness also creates a new Response without r.wsTarget.

Proposed fix

mohamedalichelbi@fbebac2
Namely: Encode the target:

encode_http_response(response, true)

Then add the target to the new response:

new Response(body, {
  status: r.status,
  headers: r.headers,
  __wsTarget: r.wsTarget,
})

Activity

  1. bartlomieju commented on Aug 17, 2026

    @bartlomieju
    Member

    Thanks we already fixed it and will release this week in v0.3.0.

  2. added 3 commits that reference this issue on Aug 20, 2026
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions