We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bbb6ae3 commit 61a5d2aCopy full SHA for 61a5d2a
1 file changed
app.js
@@ -18,6 +18,9 @@ var http = require('http'),
18
ss = require('socket.io-stream');
19
20
var config = require('./config.json');
21
+var use_input = true;
22
+if (config["input"] != null)
23
+ use_input = config["input"];
24
25
var server = http.createServer()
26
.listen(config.port, config.interface);
@@ -56,7 +59,12 @@ socketio(server).of('pty').on('connection', function(socket) {
56
59
var name = options.name;
57
60
58
61
var pty = child_pty.spawn('/bin/sh', ['-c', config.login], options);
- pty.stdout.pipe(stream).pipe(pty.stdin);
62
+ if (use_input)
63
+ pty.stdout.pipe(stream).pipe(pty.stdin);
64
+ else {
65
+ pty.stdout.pipe(stream);
66
+ stream.on('data', function(chunk) {});
67
+ }
68
ptys[name] = pty;
69
socket.on('disconnect', function() {
70
console.log("end");
0 commit comments