Update ssh.ts to fix 60 second disconnect
This commit is contained in:
@@ -130,6 +130,12 @@ wss.on('connection', (ws: WebSocket) => {
|
|||||||
|
|
||||||
sshStream = stream;
|
sshStream = stream;
|
||||||
|
|
||||||
|
const keepaliveTimer = setInterval(() => {
|
||||||
|
if (sshStream && sshStream.writable) {
|
||||||
|
sshStream.write('\x00');
|
||||||
|
}
|
||||||
|
}, 30000);
|
||||||
|
|
||||||
stream.on('data', (chunk: Buffer) => {
|
stream.on('data', (chunk: Buffer) => {
|
||||||
ws.send(JSON.stringify({ type: 'data', data: chunk.toString() }));
|
ws.send(JSON.stringify({ type: 'data', data: chunk.toString() }));
|
||||||
});
|
});
|
||||||
@@ -177,8 +183,8 @@ wss.on('connection', (ws: WebSocket) => {
|
|||||||
host: ip,
|
host: ip,
|
||||||
port,
|
port,
|
||||||
username,
|
username,
|
||||||
keepaliveInterval: 5000,
|
keepaliveInterval: 10000,
|
||||||
keepaliveCountMax: 10,
|
keepaliveCountMax: 60,
|
||||||
readyTimeout: 10000,
|
readyTimeout: 10000,
|
||||||
|
|
||||||
algorithms: {
|
algorithms: {
|
||||||
|
|||||||
Reference in New Issue
Block a user