Created
December 7, 2015 22:58
-
-
Save brunokrebs/7abd6e9811fd1f50be22 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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