@nifrajs/workers 2.11.0 → 2.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -5
- package/src/index.ts +3 -0
package/package.json
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nifrajs/workers",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.0",
|
|
4
4
|
"description": "Cloudflare Workers helpers for nifra - a Durable Object hub for cross-connection WebSocket broadcast.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bun",
|
|
7
7
|
"typescript",
|
|
8
8
|
"nifra",
|
|
9
|
-
"
|
|
10
|
-
"
|
|
9
|
+
"cloudflare",
|
|
10
|
+
"cloudflare-workers",
|
|
11
|
+
"durable-objects",
|
|
11
12
|
"edge",
|
|
12
|
-
"
|
|
13
|
+
"websockets",
|
|
14
|
+
"adapter"
|
|
13
15
|
],
|
|
14
16
|
"type": "module",
|
|
15
17
|
"types": "./src/index.ts",
|
|
@@ -29,7 +31,7 @@
|
|
|
29
31
|
"access": "public"
|
|
30
32
|
},
|
|
31
33
|
"dependencies": {
|
|
32
|
-
"@nifrajs/core": "2.
|
|
34
|
+
"@nifrajs/core": "2.12.0"
|
|
33
35
|
},
|
|
34
36
|
"repository": {
|
|
35
37
|
"type": "git",
|
package/src/index.ts
CHANGED
|
@@ -105,6 +105,9 @@ export function createWebSocketHub<Env = unknown>(
|
|
|
105
105
|
attachWebSocket(server, outcome.handler, outcome.data, {
|
|
106
106
|
openNow: true,
|
|
107
107
|
pubsub: outcome.pubsub,
|
|
108
|
+
...(outcome.maxPayloadBytes === undefined
|
|
109
|
+
? {}
|
|
110
|
+
: { maxPayloadBytes: outcome.maxPayloadBytes }),
|
|
108
111
|
})
|
|
109
112
|
// `webSocket` is a Workers-only `ResponseInit` field, and 101 is only valid on Workers.
|
|
110
113
|
return new Response(null, { status: 101, webSocket: pair[0] } as unknown as ResponseInit)
|