diff --git a/packages/compose-tunnel-agent/src/ssh/tunnel-client.ts b/packages/compose-tunnel-agent/src/ssh/tunnel-client.ts index 1bdee76c..d4dcff01 100644 --- a/packages/compose-tunnel-agent/src/ssh/tunnel-client.ts +++ b/packages/compose-tunnel-agent/src/ssh/tunnel-client.ts @@ -68,7 +68,7 @@ export const sshClient = async ({ channel.on('close', () => localServiceSocket.destroy()) localServiceSocket.on('close', () => { sockets.delete(localServiceSocket) - channel.close() + channel.end() // close the channel, but only after the localServiceSocket data has been piped }) }) localServiceSocket.on('error', err => {