1.0.2 • Published 5 years ago
rustrcon v1.0.2
RustRCON
Rust RCON client for NodeJS
npm install rustrcon
or
yarn add rustrcon
Usage
const { Client } = require('../src/index.js');
const rcon = new Client({
ip: '192.0.0.1',
port: '8080',
password: '123'
});
rcon.login();
rcon.on('connected', () => {
console.log(`Connected to ${rcon.ws.ip}:${rcon.ws.port}`);
// Message, Name, Identifier.
rcon.send('serverinfo', 'Artful', 10);
setTimeout(() => {
rcon.destroy();
}, 5000);
});
rcon.on('error', err => {
console.error(err);
});
rcon.on('disconnect', () => {
console.log('Disconnected from RCON websocket');
});
rcon.on('message', message => {
console.log(message);
});
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Credits
Kye github
License
MIT