@otto-code/relay 0.7.6 → 0.8.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.
|
@@ -20,7 +20,7 @@ import { createCutoverProxy } from "./cutover-proxy.js";
|
|
|
20
20
|
const LEGACY_RELAY_VERSION = "1";
|
|
21
21
|
const CURRENT_RELAY_VERSION = "2";
|
|
22
22
|
// Client frames are buffered while no daemon data socket is attached. Cloudflare caps a single
|
|
23
|
-
// WebSocket message at 1 MiB, so a count-only trim still admits ~200 MiB per connectionId
|
|
23
|
+
// WebSocket message at 1 MiB, so a count-only trim still admits ~200 MiB per connectionId - past
|
|
24
24
|
// the Durable Object's 128 MB memory limit. Legitimate buffered traffic is only a client's
|
|
25
25
|
// pre-attach opening frames (the E2EE handshake init, well under a kilobyte); large payloads such
|
|
26
26
|
// as screenshots or file content flow only after the server data socket exists and are never
|
|
@@ -194,7 +194,7 @@ export class RelayDurableObject {
|
|
|
194
194
|
}, initialDelayMs);
|
|
195
195
|
}
|
|
196
196
|
frameByteSize(message) {
|
|
197
|
-
// For strings this counts UTF-16 code units, not UTF-8 bytes (off by at most 3x)
|
|
197
|
+
// For strings this counts UTF-16 code units, not UTF-8 bytes (off by at most 3x) - close
|
|
198
198
|
// enough for a resource cap.
|
|
199
199
|
return typeof message === "string" ? message.length : message.byteLength;
|
|
200
200
|
}
|