#14449·meteor

Clarify the status of `RawWebSocketConnection` while no shipped transport uses it

Author: dupontbertrandCreated Jun 9, 2026Updated Sep 26, 2026
LabelsProject:DocsProject:DDPin-discussionidle

Context

packages/ddp-server/transports/raw_connection.js defines RawWebSocketConnection, introduced in #14231 as part of the pluggable transport layer.

It was the shared wrapper used to adapt standard Node WebSocket implementations (ws / faye-websocket) into the SockJS-like socket interface DDP expects.

Both standard-WebSocket consumers were later removed in commit b700e0aa53 ("keep only sockjs and uws transports"), as discussed in #14231, so Meteor 3.5 ships only:

  • sockjs as the default transport
  • uws as the opt-in alternative transport

The RawWebSocketConnection file was intentionally kept as a reusable adapter for a future pluggable standard-WebSocket transport.

Problem

In the current shipped state, no transport appears to instantiate RawWebSocketConnection:

  • uws.js adapts the uWS socket inline, because uWS has a non-standard socket API.
  • sockjs.js goes through SockJS directly.

So RawWebSocketConnection is still present in the package, but it is not currently imported or constructed by either active transport.

A repo-wide search for:

bash
grep -R "new RawWebSocketConnection" packages/ddp-server

returns no active usage.

This surfaced in #14446, which added cookie to the class's header whitelist. That change is correct for a future standard-WebSocket transport using this adapter, but it is currently a no-op for both shipped transports.

Question / options

What should we do with RawWebSocketConnection while no active transport uses it?

  1. Keep it as a documented extension point

    Add a short comment/doc note explaining that this adapter is intentionally kept for future standard-WebSocket transports.

    Pro: preserves the reusable adapter and lowers the barrier to re-adding a ws-style transport later.

    Con: the code remains unused in the current shipped transport set.

  2. Remove it until a transport needs it again

    Remove RawWebSocketConnection for now and reintroduce it alongside the next standard-WebSocket transport.

    Pro: avoids carrying unused code.

    Con: the shared adapter design may need to be re-discussed/recreated when a standard-WebSocket transport returns.

Related context

  • #14231
  • #14446
  • commit b700e0aa53