@mblaney/holster 1.0.21 → 1.0.22
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/.dockerignore +9 -0
- package/Dockerfile +20 -0
- package/README.md +15 -3
- package/build/holster.js +1 -1
- package/build/holster.js.map +2 -2
- package/package.json +1 -1
- package/src/wire.js +3 -3
package/package.json
CHANGED
package/src/wire.js
CHANGED
|
@@ -15,7 +15,7 @@ if (typeof globalThis.WebSocket === "undefined") {
|
|
|
15
15
|
// Rate limiting with throttling
|
|
16
16
|
const createRateLimiter = isTestEnv => {
|
|
17
17
|
const clients = new Map()
|
|
18
|
-
const maxRequests =
|
|
18
|
+
const maxRequests = 1500 // requests per minute
|
|
19
19
|
const windowMs = 60000 // 1 minute window
|
|
20
20
|
const disconnectThreshold = 10 // Disconnect after 10 violations
|
|
21
21
|
let cleanupInterval = null
|
|
@@ -654,7 +654,7 @@ const Wire = opt => {
|
|
|
654
654
|
// Schedule processing of next message if queue not empty
|
|
655
655
|
if (messageQueue.length > 0) {
|
|
656
656
|
// Add delay between messages to respect rate limit
|
|
657
|
-
queueProcessor = setTimeout(processQueue,
|
|
657
|
+
queueProcessor = setTimeout(processQueue, 50)
|
|
658
658
|
} else {
|
|
659
659
|
queueProcessor = null
|
|
660
660
|
}
|
|
@@ -698,7 +698,7 @@ const Wire = opt => {
|
|
|
698
698
|
messageQueue.push(data)
|
|
699
699
|
// Start queue processor if not already running
|
|
700
700
|
if (!queueProcessor) {
|
|
701
|
-
queueProcessor = setTimeout(processQueue,
|
|
701
|
+
queueProcessor = setTimeout(processQueue, 50)
|
|
702
702
|
}
|
|
703
703
|
}
|
|
704
704
|
if (!(opt.peers instanceof Array)) {
|