INNER CODE UNIT · JavaScript
cmd
bvisible/mcp-ssh-manager · src/index.js:471
const cmd = proxyCommand.replace(/%h/g, host).replace(/%p/g, port.toString());
return new Promise((resolve, reject) => {
const child = spawn(cmd, {
shell: true,
stdio: ['pipe', 'pipe', 'pipe']
});
// Cast: Node accepts a {readable, writable} pair here, but the bundled
// types only model the stream/iterable overloads.
const socket = Duplex.from(/** @type {any} */ ({
readable: child.stdout,
writable: child.stdin,
allowHalfOpen: false
}));
// Forward proxy stderr to the MCP server's stderr for debugging
child.stderr.on('data', (chunk) => {