@dev-anywhere/relay 0.4.82 → 0.4.84
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/dist/{chunk-5B2OTBDL.js → chunk-46NK2URF.js} +8 -7
- package/dist/chunk-46NK2URF.js.map +1 -0
- package/dist/handlers/client.d.ts.map +1 -1
- package/dist/handlers/proxy.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/server.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-5B2OTBDL.js.map +0 -1
|
@@ -1007,6 +1007,10 @@ var RelayCloseCode = {
|
|
|
1007
1007
|
CLIENT_PROTOCOL_REJECTED: 4402
|
|
1008
1008
|
};
|
|
1009
1009
|
|
|
1010
|
+
// ../../packages/shared/dist/constants/wire-limits.js
|
|
1011
|
+
var RELAY_JSON_MESSAGE_MAX_BYTES = 8 * 1024 * 1024;
|
|
1012
|
+
var RELAY_BINARY_FRAME_MAX_BYTES = 10 * 1024 * 1024;
|
|
1013
|
+
|
|
1010
1014
|
// ../../packages/shared/dist/binary-frame.js
|
|
1011
1015
|
var SID_LEN_BYTES = 1;
|
|
1012
1016
|
var SEQ_BYTES = 4;
|
|
@@ -1635,8 +1639,6 @@ function completeRelayProxyLatencyProbe({
|
|
|
1635
1639
|
}
|
|
1636
1640
|
|
|
1637
1641
|
// src/handlers/proxy.ts
|
|
1638
|
-
var MAX_BINARY_FRAME_SIZE = 10 * 1024 * 1024;
|
|
1639
|
-
var MAX_JSON_MESSAGE_SIZE = 1 * 1024 * 1024;
|
|
1640
1642
|
function notifyClientsProxyOffline(proxyId, registry, logger, chaos) {
|
|
1641
1643
|
const clients = registry.getClientsForProxy(proxyId);
|
|
1642
1644
|
const msg = JSON.stringify({ type: "proxy_offline", proxyId });
|
|
@@ -1684,7 +1686,7 @@ function handleProxyConnection(ws, registry, logger, chaos, remoteFileBridge) {
|
|
|
1684
1686
|
});
|
|
1685
1687
|
proxyWs.on("message", (data, isBinary) => {
|
|
1686
1688
|
if (isBinary) {
|
|
1687
|
-
if (data.length < 2 || data.length >
|
|
1689
|
+
if (data.length < 2 || data.length > RELAY_BINARY_FRAME_MAX_BYTES) {
|
|
1688
1690
|
logger.warn({ size: data.length }, "Binary frame rejected: invalid size");
|
|
1689
1691
|
return;
|
|
1690
1692
|
}
|
|
@@ -1711,7 +1713,7 @@ function handleProxyConnection(ws, registry, logger, chaos, remoteFileBridge) {
|
|
|
1711
1713
|
}
|
|
1712
1714
|
return;
|
|
1713
1715
|
}
|
|
1714
|
-
if (data.length >
|
|
1716
|
+
if (data.length > RELAY_JSON_MESSAGE_MAX_BYTES) {
|
|
1715
1717
|
logger.warn(
|
|
1716
1718
|
{ size: data.length, proxyId: proxyWs.proxyId },
|
|
1717
1719
|
"JSON message rejected: exceeds max size"
|
|
@@ -2523,7 +2525,6 @@ function handleVoiceConfigControl(msg, ws, store, logger, providers) {
|
|
|
2523
2525
|
}
|
|
2524
2526
|
|
|
2525
2527
|
// src/handlers/client.ts
|
|
2526
|
-
var MAX_JSON_MESSAGE_SIZE2 = 1 * 1024 * 1024;
|
|
2527
2528
|
function isMalformedClientRegister(raw) {
|
|
2528
2529
|
try {
|
|
2529
2530
|
const parsed = JSON.parse(raw);
|
|
@@ -2728,7 +2729,7 @@ function handleClientConnection(ws, registry, logger, chaos, voiceConfigStore, v
|
|
|
2728
2729
|
if (isBinary) {
|
|
2729
2730
|
return;
|
|
2730
2731
|
}
|
|
2731
|
-
if (data.length >
|
|
2732
|
+
if (data.length > RELAY_JSON_MESSAGE_MAX_BYTES) {
|
|
2732
2733
|
logger.warn(
|
|
2733
2734
|
{ size: data.length, clientId: clientWs.clientId },
|
|
2734
2735
|
"JSON message rejected: exceeds max size"
|
|
@@ -4305,4 +4306,4 @@ export {
|
|
|
4305
4306
|
parseRelayChaosFromEnv,
|
|
4306
4307
|
createRelayServer
|
|
4307
4308
|
};
|
|
4308
|
-
//# sourceMappingURL=chunk-
|
|
4309
|
+
//# sourceMappingURL=chunk-46NK2URF.js.map
|