sliccy 2.5.1 → 2.5.3
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/node-server/index.js +18 -2
- package/package.json +1 -1
|
@@ -1033,7 +1033,13 @@ async function main() {
|
|
|
1033
1033
|
});
|
|
1034
1034
|
}
|
|
1035
1035
|
// 4. CDP WebSocket proxy at /cdp
|
|
1036
|
-
// Use noServer mode so Vite's dev middleware doesn't intercept the
|
|
1036
|
+
// Use noServer mode so Vite's dev middleware doesn't intercept the
|
|
1037
|
+
// upgrade. Keep the default per-message payload cap on this socket —
|
|
1038
|
+
// the oversized-message feedback loop we have to defend against
|
|
1039
|
+
// (see the chromeWs constructor below for the full writeup) is
|
|
1040
|
+
// purely Chrome-to-proxy, never client-to-proxy, so raising the
|
|
1041
|
+
// cap here would only widen the DoS surface for anything on
|
|
1042
|
+
// localhost that can reach ws://127.0.0.1:PORT/cdp.
|
|
1037
1043
|
const wss = new WebSocketServer({ noServer: true });
|
|
1038
1044
|
server.on('upgrade', (request, socket, head) => {
|
|
1039
1045
|
const { pathname } = new URL(request.url, `http://${request.headers.host}`);
|
|
@@ -1169,7 +1175,17 @@ async function main() {
|
|
|
1169
1175
|
}
|
|
1170
1176
|
}
|
|
1171
1177
|
messageBuffer = [];
|
|
1172
|
-
|
|
1178
|
+
// Disable the ws library's per-message size cap (default 100 MiB).
|
|
1179
|
+
// The slicc UI runs INSIDE the Chrome instance it's debugging, so
|
|
1180
|
+
// Chrome's Network domain reports every CDP frame — including the
|
|
1181
|
+
// event frames themselves — back to us as `Network.webSocketFrame*`
|
|
1182
|
+
// messages that each embed the prior frame's payload. That produces
|
|
1183
|
+
// an exponential feedback loop which, left unchecked, trips the
|
|
1184
|
+
// default 100 MiB cap and closes the Chrome WebSocket (code 1006).
|
|
1185
|
+
// Without the cap the loop is still bounded by Chrome's own frame
|
|
1186
|
+
// limits, but the proxy no longer dies and later CDP calls like
|
|
1187
|
+
// `Target.getTargets` keep working instead of being DROPPED.
|
|
1188
|
+
chromeWs = new WebSocket(url, { maxPayload: 0 });
|
|
1173
1189
|
chromeWs.on('open', () => {
|
|
1174
1190
|
console.log('[cdp-proxy] chromeWs open');
|
|
1175
1191
|
// Flush buffered messages
|