feat: 增加ws重连机制
This commit is contained in:
@@ -102,8 +102,8 @@ export const establishSshConnection = (
|
||||
privateKey: connDetails.privateKey,
|
||||
passphrase: connDetails.passphrase,
|
||||
readyTimeout: timeout,
|
||||
keepaliveInterval: 30000, // 保持连接
|
||||
keepaliveCountMax: 3,
|
||||
keepaliveInterval: 10000, // 保持连接
|
||||
keepaliveCountMax: 10,
|
||||
};
|
||||
|
||||
const readyHandler = () => {
|
||||
|
||||
@@ -92,7 +92,7 @@ export const initializeWebSocket = (server: http.Server, sessionParser: RequestH
|
||||
extWs.isAlive = false;
|
||||
extWs.ping(() => {});
|
||||
});
|
||||
}, 30000); // 30 秒心跳间隔
|
||||
}, 60000); // 增加到 60 秒心跳间隔
|
||||
|
||||
// --- WebSocket 升级处理 (认证) ---
|
||||
server.on('upgrade', (request: Request, socket, head) => {
|
||||
|
||||
Reference in New Issue
Block a user