I'm trying to setup a rcon function, and I'm using node-rcon . With the example provided it works perfectly, but with my code, it doesn't work, I can't figure out why. Any clue what's the issue with my code? It throws no errors, but the server doesn't recieve the rcon command. Here's my code:
var Rcon = require('../node-rcon');
console.log('Starting the rcon...');
var conn = new Rcon('localhost', 30120, 'test123', options);
conn.on('auth', function() {
console.log("Authed!");
}).on('response', function(str) {
console.log("Got response: " + str);
}).on('end', function() {
console.log("Socket closed!");
process.exit();
});
conn.connect();
conn.send("say working!");
conn.disconnect();
It's a nodejs, and yes, the example works for me just fine.