File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,9 @@ var http = require('http'),
1818 ss = require ( 'socket.io-stream' ) ;
1919
2020var config = require ( './config.json' ) ;
21+ var use_input = true ;
22+ if ( config [ "input" ] != null )
23+ use_input = config [ "input" ] ;
2124
2225var server = http . createServer ( )
2326 . listen ( config . port , config . interface ) ;
@@ -56,7 +59,12 @@ socketio(server).of('pty').on('connection', function(socket) {
5659 var name = options . name ;
5760
5861 var pty = child_pty . spawn ( '/bin/sh' , [ '-c' , config . login ] , options ) ;
59- 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+ }
6068 ptys [ name ] = pty ;
6169 socket . on ( 'disconnect' , function ( ) {
6270 console . log ( "end" ) ;
You can’t perform that action at this time.
0 commit comments