velocious 1.0.565 → 1.0.567
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/README.md +5 -1
- package/bin/velocious.js +28 -1
- package/build/bin/velocious.js +28 -1
- package/build/configuration-types.js +1 -0
- package/build/configuration.js +20 -0
- package/build/http-server/client/websocket-session.js +455 -69
- package/build/src/configuration-types.d.ts +8 -0
- package/build/src/configuration-types.d.ts.map +1 -1
- package/build/src/configuration-types.js +2 -1
- package/build/src/configuration.d.ts +12 -0
- package/build/src/configuration.d.ts.map +1 -1
- package/build/src/configuration.js +19 -1
- package/build/src/http-server/client/websocket-session.d.ts +102 -4
- package/build/src/http-server/client/websocket-session.d.ts.map +1 -1
- package/build/src/http-server/client/websocket-session.js +404 -67
- package/package.json +1 -1
- package/src/configuration-types.js +1 -0
- package/src/configuration.js +20 -0
- package/src/http-server/client/websocket-session.js +455 -69
package/package.json
CHANGED
|
@@ -255,6 +255,7 @@
|
|
|
255
255
|
* @property {boolean} [inProcess] - Run HTTP handlers in the main thread instead of worker threads.
|
|
256
256
|
* @property {number} [maxWorkers] - Backward-compatible alias for workers.
|
|
257
257
|
* @property {number} [port] - Port to bind the HTTP server to.
|
|
258
|
+
* @property {{maxPendingBytes?: number, maxPendingMessages?: number}} [websocketInboundQueue] - Per-session retained inbound WebSocket message limits.
|
|
258
259
|
* @property {{maxPendingBytes?: number, maxPendingFrames?: number}} [websocketOutboundQueue] - Per-client retained outbound WebSocket frame limits.
|
|
259
260
|
* @property {number} [workers] - Worker handlers to start for the HTTP server.
|
|
260
261
|
*/
|
package/src/configuration.js
CHANGED
|
@@ -114,6 +114,8 @@ function resolveBeaconUnreachableReportMs(value) {
|
|
|
114
114
|
return 30_000
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
+
const DEFAULT_WEBSOCKET_INBOUND_MAX_PENDING_BYTES = 16 * 1024 * 1024
|
|
118
|
+
const DEFAULT_WEBSOCKET_INBOUND_MAX_PENDING_MESSAGES = 256
|
|
117
119
|
const DEFAULT_WEBSOCKET_OUTBOUND_MAX_PENDING_BYTES = 16 * 1024 * 1024
|
|
118
120
|
const DEFAULT_WEBSOCKET_OUTBOUND_MAX_PENDING_FRAMES = 256
|
|
119
121
|
|
|
@@ -228,10 +230,15 @@ export default class VelociousConfiguration {
|
|
|
228
230
|
* @type {Promise<void> | undefined}
|
|
229
231
|
*/
|
|
230
232
|
this._initializePromise = undefined
|
|
233
|
+
const websocketInboundQueue = httpServer?.websocketInboundQueue
|
|
231
234
|
const websocketOutboundQueue = httpServer?.websocketOutboundQueue
|
|
232
235
|
|
|
233
236
|
this.httpServer = {
|
|
234
237
|
...(httpServer || {}),
|
|
238
|
+
websocketInboundQueue: {
|
|
239
|
+
maxPendingBytes: positiveSafeInteger(websocketInboundQueue?.maxPendingBytes, "httpServer.websocketInboundQueue.maxPendingBytes", DEFAULT_WEBSOCKET_INBOUND_MAX_PENDING_BYTES),
|
|
240
|
+
maxPendingMessages: positiveSafeInteger(websocketInboundQueue?.maxPendingMessages, "httpServer.websocketInboundQueue.maxPendingMessages", DEFAULT_WEBSOCKET_INBOUND_MAX_PENDING_MESSAGES)
|
|
241
|
+
},
|
|
235
242
|
websocketOutboundQueue: {
|
|
236
243
|
maxPendingBytes: positiveSafeInteger(websocketOutboundQueue?.maxPendingBytes, "httpServer.websocketOutboundQueue.maxPendingBytes", DEFAULT_WEBSOCKET_OUTBOUND_MAX_PENDING_BYTES),
|
|
237
244
|
maxPendingFrames: positiveSafeInteger(websocketOutboundQueue?.maxPendingFrames, "httpServer.websocketOutboundQueue.maxPendingFrames", DEFAULT_WEBSOCKET_OUTBOUND_MAX_PENDING_FRAMES)
|
|
@@ -2370,6 +2377,19 @@ export default class VelociousConfiguration {
|
|
|
2370
2377
|
*/
|
|
2371
2378
|
getWebsocketSessionHeartbeatSeconds() { return this._websocketSessionHeartbeatSeconds }
|
|
2372
2379
|
|
|
2380
|
+
/**
|
|
2381
|
+
* Gets per-session WebSocket inbound message queue limits.
|
|
2382
|
+
* @returns {{maxBytes: number, maxMessages: number}} - Per-session inbound queue high-water marks.
|
|
2383
|
+
*/
|
|
2384
|
+
getWebsocketInboundQueueLimits() {
|
|
2385
|
+
const queue = this.httpServer.websocketInboundQueue
|
|
2386
|
+
|
|
2387
|
+
return {
|
|
2388
|
+
maxBytes: queue.maxPendingBytes,
|
|
2389
|
+
maxMessages: queue.maxPendingMessages
|
|
2390
|
+
}
|
|
2391
|
+
}
|
|
2392
|
+
|
|
2373
2393
|
/**
|
|
2374
2394
|
* Gets per-client WebSocket outbound queue limits.
|
|
2375
2395
|
* @returns {{maxBytes: number, maxFrames: number}} - Per-client outbound queue high-water marks.
|