Fixed the banner newline/carriage return fix...
To not capture \r\n when looking for \r to fix formatting of banner messages.
This commit is contained in:
parent
1725cdaa85
commit
b86ae3e88d
1 changed files with 2 additions and 2 deletions
4
index.js
4
index.js
|
@ -61,7 +61,7 @@ io.on('connection', function(socket) {
|
||||||
var conn = new ssh();
|
var conn = new ssh();
|
||||||
conn.on('banner', function(d) {
|
conn.on('banner', function(d) {
|
||||||
//need to convert to cr/lf for proper formatting
|
//need to convert to cr/lf for proper formatting
|
||||||
d = d.replace(/\n/g, "\r\n");
|
d = d.replace(/\r?\n/g, "\r\n");
|
||||||
socket.emit('data', d.toString('binary'));
|
socket.emit('data', d.toString('binary'));
|
||||||
}).on('ready', function() {
|
}).on('ready', function() {
|
||||||
socket.emit('title', 'ssh://' + config.ssh.host);
|
socket.emit('title', 'ssh://' + config.ssh.host);
|
||||||
|
@ -114,4 +114,4 @@ io.on('connection', function(socket) {
|
||||||
'hmac': ['hmac-sha1', 'hmac-sha1-96', 'hmac-md5-96']
|
'hmac': ['hmac-sha1', 'hmac-sha1-96', 'hmac-md5-96']
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue