Open History to see the last commit
1diff --git a/dist/NodeHttpServer.js b/dist/NodeHttpServer.js
2index ab7c9354853032fefa192ebfa8ab2026bac6ddb7..319815f01e78f5d4e6f7e62a00046ec092eaf797 100644
3--- a/dist/NodeHttpServer.js
4+++ b/dist/NodeHttpServer.js
5@@ -83,7 +83,17 @@ export const make = /*#__PURE__*/Effect.fnUntraced(function* (evaluate, options)
6 });
7 const address = server.address();
8 const wss = yield* Effect.acquireRelease(Effect.sync(() => new NodeWS.WebSocketServer({
9- noServer: true
10+ noServer: true,
11+ // Patch: upstreamed as https://github.com/Effect-TS/effect/pull/6691 (ships
12+ // in >= 4.0.0-beta.103 as the layer option `websocket: { perMessageDeflate }`).
13+ // On upgrade: drop this patch and pass the option in apps/server/src/server.ts.
14+ // Negotiate permessage-deflate with clients that offer it; clients that
15+ // don't still get uncompressed frames on their connection. Context
16+ // takeover stays enabled (ws default) so the compression window is shared
17+ // across frames — that also makes small frames cheap to compress, so no
18+ // size threshold is set (ws only honors `threshold` when context takeover
19+ // is disabled).
20+ perMessageDeflate: true
21 })), wss => Effect.callback(resume => {
22 wss.close(() => resume(Effect.void));
23 })).pipe(Scope.provide(scope), Effect.cached);
24diff --git a/src/NodeHttpServer.ts b/src/NodeHttpServer.ts
25index e18cd931f17c26d6ca985a2d1ece9e9d760851d3..9c888a581738aea12dbdb2b213cce1c480aa2ecc 100644
26--- a/src/NodeHttpServer.ts
27+++ b/src/NodeHttpServer.ts
28@@ -116,7 +116,21 @@ export const make = Effect.fnUntraced(function*(
29 const address = server.address()!
31 const wss = yield* Effect.acquireRelease(
32- Effect.sync(() => new NodeWS.WebSocketServer({ noServer: true })),
33+ Effect.sync(() =>
34+ new NodeWS.WebSocketServer({
35+ noServer: true,
36+ // Patch: upstreamed as https://github.com/Effect-TS/effect/pull/6691 (ships
37+ // in >= 4.0.0-beta.103 as the layer option `websocket: { perMessageDeflate }`).
38+ // On upgrade: drop this patch and pass the option in apps/server/src/server.ts.
39+ // Negotiate permessage-deflate with clients that offer it; clients that
40+ // don't still get uncompressed frames on their connection. Context
41+ // takeover stays enabled (ws default) so the compression window is
42+ // shared across frames — that also makes small frames cheap to
43+ // compress, so no size threshold is set (ws only honors `threshold`
44+ // when context takeover is disabled).
45+ perMessageDeflate: true
46+ })
47+ ),
48 (wss) =>
49 Effect.callback<void>((resume) => {
50 wss.close(() => resume(Effect.void))