{"action":"created","issue":{"url":"https://api.github.com/repos/mkozjak/node-telnet-client/issues/74","repository_url":"https://api.github.com/repos/mkozjak/node-telnet-client","labels_url":"https://api.github.com/repos/mkozjak/node-telnet-client/issues/74/labels{/name}","comments_url":"https://api.github.com/repos/mkozjak/node-telnet-client/issues/74/comments","events_url":"https://api.github.com/repos/mkozjak/node-telnet-client/issues/74/events","html_url":"https://github.com/mkozjak/node-telnet-client/issues/74","id":202539039,"number":74,"title":"Login connection problem","user":{"login":"vikasgoswami","id":25148293,"avatar_url":"https://avatars.githubusercontent.com/u/25148293?v=3","gravatar_id":"","url":"https://api.github.com/users/vikasgoswami","html_url":"https://github.com/vikasgoswami","followers_url":"https://api.github.com/users/vikasgoswami/followers","following_url":"https://api.github.com/users/vikasgoswami/following{/other_user}","gists_url":"https://api.github.com/users/vikasgoswami/gists{/gist_id}","starred_url":"https://api.github.com/users/vikasgoswami/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vikasgoswami/subscriptions","organizations_url":"https://api.github.com/users/vikasgoswami/orgs","repos_url":"https://api.github.com/users/vikasgoswami/repos","events_url":"https://api.github.com/users/vikasgoswami/events{/privacy}","received_events_url":"https://api.github.com/users/vikasgoswami/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-01-23T13:52:20Z","updated_at":"2017-01-23T19:10:52Z","closed_at":null,"body":"```\r\nvar telnet = require('telnet-client');\r\nvar connection = new telnet();\r\n\r\nvar params = {\r\n  host: '127.0.0.1',\r\n  port: 23,\r\n  shellPrompt: ' ',\r\n username: 'root',\r\npassword: 'root',\r\n  timeout: 1500\r\n};\r\n\r\nconnection.on('ready', function(prompt) {\r\n  connection.exec(cmd, function(err, response) {\r\n    console.log(response);\r\n  });\r\n});\r\n\r\nconnection.on('timeout', function() {\r\n  console.log('socket timeout!')\r\n  connection.end();\r\n});\r\n\r\nconnection.on('close', function() {\r\n  console.log('connection closed');\r\n});\r\n\r\nconnection.connect(params);\r\n```\r\n\r\n1. Can we use username and password in the params object? I tried to use this way, but I am getting Login Incorrect error.\r\n\r\n2. If connection is not successful, then connection.ready function should not be accessed. But from above code, it is accessible.\r\n\r\n3. Connection is getting closed, after one command is executed.\r\n\r\n4. I have used shell method inside connection.ready block. Is it correct?\r\n\r\n5. I observed, whole function syntax is getting write on the terminal if we used send method before shell method. Could you please let me know, is there any mistake from my side?"},"comment":{"url":"https://api.github.com/repos/mkozjak/node-telnet-client/issues/comments/274586303","html_url":"https://github.com/mkozjak/node-telnet-client/issues/74#issuecomment-274586303","issue_url":"https://api.github.com/repos/mkozjak/node-telnet-client/issues/74","id":274586303,"user":{"login":"mkozjak","id":3506172,"avatar_url":"https://avatars.githubusercontent.com/u/3506172?v=3","gravatar_id":"","url":"https://api.github.com/users/mkozjak","html_url":"https://github.com/mkozjak","followers_url":"https://api.github.com/users/mkozjak/followers","following_url":"https://api.github.com/users/mkozjak/following{/other_user}","gists_url":"https://api.github.com/users/mkozjak/gists{/gist_id}","starred_url":"https://api.github.com/users/mkozjak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkozjak/subscriptions","organizations_url":"https://api.github.com/users/mkozjak/orgs","repos_url":"https://api.github.com/users/mkozjak/repos","events_url":"https://api.github.com/users/mkozjak/events{/privacy}","received_events_url":"https://api.github.com/users/mkozjak/received_events","type":"User","site_admin":false},"created_at":"2017-01-23T19:10:52Z","updated_at":"2017-01-23T19:10:52Z","body":"@vikasgoswami Yes, you should set both loginPrompt and passwordPrompt parameters, also. Make sure shellPrompt is correct!"}}
{"actor":{"display_login":"mkozjak"}}