Nano and timeout error fix #6
This commit is contained in:
@@ -59,16 +59,8 @@ wss.on('connection', (ws) => {
|
|||||||
|
|
||||||
// Forward user input and resize events to the SSH stream
|
// Forward user input and resize events to the SSH stream
|
||||||
ws.on('message', (message) => {
|
ws.on('message', (message) => {
|
||||||
if (typeof message === 'string') {
|
console.log('User Input:', message);
|
||||||
try {
|
|
||||||
const resizeEvent = JSON.parse(message);
|
|
||||||
if (resizeEvent.type === 'resize') {
|
|
||||||
stream.setWindow(resizeEvent.rows, resizeEvent.cols, resizeEvent.height, resizeEvent.width);
|
|
||||||
}
|
|
||||||
} catch {
|
|
||||||
stream.write(message);
|
stream.write(message);
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user