Last active
September 6, 2022 09:50
-
-
Save SomeBottle/b644a2b6ad585e33d35e10f5e2b497c5 to your computer and use it in GitHub Desktop.
RCON TEST
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Rcon = require('rcon'); | |
var conn = new Rcon('127.0.0.1', 25575, '123456'); | |
conn.on('auth', function () { | |
// You must wait until this event is fired before sending any commands, | |
// otherwise those commands will fail. | |
console.log("Authenticated"); | |
console.log("Sending command: help") | |
conn.send("help"); | |
}).on('response', function (str) { | |
console.log("Response: " + str); | |
}).on('error', function (err) { | |
console.log("Error: " + err); | |
}).on('end', function () { | |
console.log("Connection closed"); | |
process.exit(); | |
}); | |
conn.connect(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment