Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Telnet = require('telnet-client')
- var connection = new Telnet()
- var params = {
- host: '192.168.1.79',
- port: 23,
- shellPrompt: '/ # ',
- timeout: 1500,
- // removeEcho: 4
- }
- connection.on('ready', function(prompt) {
- connection.exec(cmd, function(err, response) {
- console.log(response)
- })
- })
- connection.on('timeout', function() {
- console.log('socket timeout!')
- connection.end()
- })
- connection.on('close', function() {
- console.log('connection closed')
- })
- connection.connect(params)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement