We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to save the value of the on('response') to a variable I can pull after conn.connect(), so that it can be passed over as a return value?
var response; const rcon = require("./rcon.js"); var options = { tcp: true, challenge:false }; var conn = new Rcon('192.168.1.101', 27020, rconPass, options); conn.on('auth', function() { conn.send("listplayers"); }).on('response', function(str) { response = str; }); conn.connect(); return response;
There's an example of what I'd like to do.
The text was updated successfully, but these errors were encountered:
function rconCall(rconCMD,callback){ var conn = new Rcon((process.env.Global_IP),(process.env.ASA_rcon_port),(process.env.ASA_password),rconoptions);
conn.on('auth', function() { conn.send(rconCMD); }).on('response', function(rconInfo) { console.log("Response: " + rconInfo); conn.emit('end'); return callback(rconInfo); }).on('error', function(err) { console.log("Error: " + err); }).on('end', function() { conn.disconnect(); }); conn.connect();
};
rconCall("GetChat",function(response){ Some code that uses your response here });
Sorry, something went wrong.
No branches or pull requests
Is it possible to save the value of the on('response') to a variable I can pull after conn.connect(), so that it can be passed over as a return value?
There's an example of what I'd like to do.
The text was updated successfully, but these errors were encountered: