This commit is contained in:
Baobhan Sith
2025-04-29 19:09:19 +08:00
parent 1b4896a1f0
commit 03d3df88e9
2 changed files with 52 additions and 12 deletions
+4 -2
View File
@@ -831,9 +831,11 @@ export const initializeWebSocket = async (server: http.Server, sessionParser: Re
reason: connectError.message
});
ws.send(JSON.stringify({ type: 'ssh:error', payload: `连接失败: ${connectError.message}` }));
}
// 在 SSH 连接建立失败时关闭 WebSocket
ws.close(1011, `SSH Connection Failed: ${connectError.message}`);
}
break;
}
}
// --- SSH 输入 ---
case 'ssh:input': {