🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

shell-cluster

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shell-cluster - npm Package Compare versions

Comparing version
1.0.12
to
1.0.13
+1
-1
package.json
{
"name": "shell-cluster",
"version": "1.0.12",
"version": "1.0.13",
"description": "Decentralized remote shell access via tunnels — Node.js server with node-pty and xterm-headless",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -145,2 +145,5 @@ /**

});
process.on('exit', (code) => {
console.error(`[Daemon] Process exiting with code=${code}`);
});

@@ -147,0 +150,0 @@ // Verify node-pty before anything else

@@ -243,7 +243,22 @@ /**

// --- Batched PTY input: reduce write frequency to ConPTY ---
let inputBuf = [];
let inputTimer = null;
const flushInput = () => {
inputTimer = null;
if (inputBuf.length === 0) return;
const combined = Buffer.concat(inputBuf);
inputBuf = [];
this._shellManager.write(sessionId, combined);
};
// Handle incoming messages
ws.on('message', (data, isBinary) => {
if (isBinary) {
// Binary frame = PTY input
this._shellManager.write(sessionId, data);
// Binary frame = PTY input — batch to reduce ConPTY pressure
inputBuf.push(data);
if (!inputTimer) {
inputTimer = setTimeout(flushInput, 8);
}
} else {

@@ -281,5 +296,7 @@ // Text frame — try JSON control

console.log(`[ShellServer] WS closed session=${sessionId} code=${code} reason="${reasonStr}"`);
// Clean up flush timer
// Clean up timers
if (flushTimer) { clearTimeout(flushTimer); flushTimer = null; }
if (inputTimer) { clearTimeout(inputTimer); inputTimer = null; }
outputBuf = [];
inputBuf = [];
this._shellManager.detach(sessionId, onOutput, onExit);

@@ -286,0 +303,0 @@ // Ensure PTY is resumed in case backpressure left it paused