mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
refactor(terminal) module.exports
This commit is contained in:
parent
d3dd66563c
commit
a03e44278b
1 changed files with 6 additions and 6 deletions
|
|
@ -21,16 +21,16 @@
|
|||
ConNum = 0;
|
||||
|
||||
module.exports = function(socket) {
|
||||
var makePty = function(socket) {
|
||||
onConnection(socket, function(channel, data) {
|
||||
socket.emit(channel, data);
|
||||
});
|
||||
};
|
||||
Util.checkArgs(arguments, ['socket']);
|
||||
|
||||
if (pty)
|
||||
socket
|
||||
.of('/terminal')
|
||||
.on('connection', makePty);
|
||||
.on('connection', function(socket) {
|
||||
onConnection(socket, function(channel, data) {
|
||||
socket.emit(channel, data);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
function onConnection(socket, callback) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue