telnet-client
Advanced tools
Comparing version 0.10.7 to 0.11.0
49
app.js
@@ -1,39 +0,20 @@ | ||
var t = require('./lib/index') | ||
var c = new t() | ||
var telnet = require('./lib') | ||
var params = { | ||
var connection = new telnet() | ||
connection.connect({ | ||
host: '127.0.0.1', | ||
port: 8080, | ||
port: 1337, | ||
execTimeout: 1000, | ||
negotiationMandatory: false | ||
} | ||
c.on('failedlogin', function() { | ||
console.log('login failed') | ||
}) | ||
/* | ||
c.on("connect", function() { | ||
console.log('sending data') | ||
c.send('something', { | ||
ors: '\r\n', | ||
waitfor: '\n' | ||
}, function(error, data) { | ||
console.log('received a response', data) | ||
}) | ||
}) | ||
*/ | ||
c.connect(params).then(function() { | ||
setInterval(function() { | ||
console.log('sending') | ||
c.send('something', { | ||
ors: '\r\n', | ||
waitfor: '\n' | ||
}, function(error, data) { | ||
console.log('received a response:', error, data) | ||
}).then(function() { | ||
connection.send('hi') | ||
.then(function(res) { | ||
console.log(res) | ||
}, function(error) { | ||
console.log(error) | ||
}) | ||
}, 2000) | ||
.catch(function(error) { | ||
console.log(error) | ||
}) | ||
}) |
@@ -254,3 +254,3 @@ // Node.js Telnet client | ||
if (search(stringData, telnetObj.pageSeparator) !== -1) { | ||
telnetObj.telnetSocket.write(Buffer('20', 'hex')) | ||
telnetObj.telnetSocket.write(Buffer.from('20', 'hex')) | ||
} | ||
@@ -310,3 +310,3 @@ | ||
if (socket.writable) socket.write(Buffer(negResp, 'hex')) | ||
if (socket.writable) socket.write(Buffer.from(negResp, 'hex')) | ||
@@ -313,0 +313,0 @@ if (cmdData != undefined) return cmdData |
@@ -8,5 +8,5 @@ { | ||
}, | ||
"version": "0.10.7", | ||
"version": "0.11.0", | ||
"main": "./lib/index.js", | ||
"engine": "node >= 0.10.29", | ||
"engine": "node >= 6.9.1", | ||
"license": "MIT", | ||
@@ -13,0 +13,0 @@ "dependencies": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
4
27137
11
483