Skip to content

Instantly share code, notes, and snippets.

@brunokrebs
Created December 7, 2015 22:58
Show Gist options
  • Save brunokrebs/7abd6e9811fd1f50be22 to your computer and use it in GitHub Desktop.
Save brunokrebs/7abd6e9811fd1f50be22 to your computer and use it in GitHub Desktop.
var telnet = require('telnet-client');
var connection = new telnet();
var params = {
host: '200.192.176.65',
port: 80,
shellPrompt: '/ # ',
timeout: 2000
// removeEcho: 4
};
connection.on('connect', function() {
console.log('connect');
});
connection.on('ready', function(prompt) {
console.log('ready');
});
connection.on('timeout', function() {
console.log('socket timeout!')
connection.end();
});
connection.on('close', function() {
console.log('connection closed');
});
connection.connect(params);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment