simple-rcon
Simple, painless node RCON client for Source servers.
Install
npm install simple-rcon
Examples
var Rcon = ;var client = host: '127.0.0.1' port: '27015' password: 'rconPassword'; client;
API
-
new Rcon([options])
:options.host
: string containing host address (default '127.0.0.1')options.port
: int for server port number (default 27015)options.password
: string containing rcon passwordoptions.timeout
: int for socket timeout (default 5000ms)
-
exec(command, callback)
: Sends rcon commands to server. If exec is called before theauthenticated
event is triggered, the commands will be buffered. Upon authentication, all commands will be executed in order.command
- String containing remote commandcallback
- Function with signaturefunction(res) {}
-
close()
: Closes connection
Events
connecting
Client connecting to server.connected
Client connected to server, although not authenticated.authenticated
Client authenticated successfully with rcon password.error
Connection interrupted by an error. Event callback accepts a singleerr
argument.disconnecting
Connecting is about to close.disconnected
Connection has been closed, interrupted, or dropped.
Contributors
Further Reading
Read more about the RCON Protocol
License
MIT