shell-cluster
Advanced tools
+1
-1
| { | ||
| "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", |
+3
-0
@@ -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 |
+20
-3
@@ -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 |
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
119367
0.54%3348
0.54%