From abeabd28a22694f32dd0c96d10d2c1d6877979b2 Mon Sep 17 00:00:00 2001 From: Adam A Date: Thu, 21 Nov 2024 18:27:24 +0100 Subject: [PATCH] don't consume json body twice --- control_node.js | 2 +- control_out_proxy.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/control_node.js b/control_node.js index 35edbd4..8e73481 100755 --- a/control_node.js +++ b/control_node.js @@ -27,7 +27,7 @@ function main () { const response = await fetch(`${NODE_OUT}/pause`) const responseJson = await response.json() console.log('🟠 Pause response:', responseJson) - canConnect = (await response.json()).canConnect + canConnect = responseJson.canConnect await new Promise(resolve=>setTimeout(resolve, 100)) } }) diff --git a/control_out_proxy.js b/control_out_proxy.js index 9d21ca9..a31f534 100755 --- a/control_out_proxy.js +++ b/control_out_proxy.js @@ -49,7 +49,7 @@ async function run (localHost, controlPort, proxyConfig) { canConnect = false } if (connections.size > 0) { - console.log('Closing', connectionsJustClosed, 'open connection(s)') + console.log('Closing', connections.size, 'open connection(s)') for (const connection of connections) { try { connection.close()