diff --git a/backend/server/src/SSHSocketClient.ts b/backend/server/src/SSHSocketClient.ts index db8316d..3263203 100644 --- a/backend/server/src/SSHSocketClient.ts +++ b/backend/server/src/SSHSocketClient.ts @@ -89,10 +89,13 @@ export class SSHSocketClient { ) }) .on("data", (data: Buffer) => { + // Netcat remains open until it is closed, so we close the connection once we receive data. resolve(data.toString()) + stream.close() }) .stderr.on("data", (data: Buffer) => { reject(new Error(data.toString())) + stream.close() }) } )