https://github.com/dcodeio/webrcon
RCON over WebSocket client library and command line interface.
https://github.com/dcodeio/webrcon
Last synced: 10 months ago
JSON representation
RCON over WebSocket client library and command line interface.
- Host: GitHub
- URL: https://github.com/dcodeio/webrcon
- Owner: dcodeIO
- License: apache-2.0
- Created: 2016-03-03T22:48:08.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-03-04T00:33:28.000Z (almost 10 years ago)
- Last Synced: 2025-02-27T05:12:11.078Z (11 months ago)
- Language: JavaScript
- Size: 11.7 KB
- Stars: 19
- Watchers: 5
- Forks: 5
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
WebRcon
============
RCON over WebSocket client library and command line interface.
* Supported games: [Rust](http://playrust.com)
* Supported platforms: node.js and any modern browser (CommonJS, AMD, shim)
Usage
-----
```js
var WebRcon = require('webrconjs') // node.js only
// Create a new client:
var rcon = new WebRcon('127.0.0.1', 28025)
// Handle events:
rcon.on('connect', function() {
console.log('CONNECTED')
// Run a command once connected:
rcon.run('echo hello world!', 0)
})
rcon.on('disconnect', function() {
console.log('DISCONNECTED')
})
rcon.on('message', function(msg) {
console.log('MESSAGE:', msg)
})
rcon.on('error', function(err) {
console.log('ERROR:', err)
})
// Connect by providing the server's rcon.password:
rcon.connect('1234')
```
Browser usage
-------------
```html
var WebRcon = dcodeIO.WebRcon;
... actually the same as above ....
```
Also works as an AMD module.
Command line usage
------------------
`npm -g install webrconjs`
```
Usage: webrcon [port] [password]
Examples:
webrcon 127.0.0.1 27015 p4ssw0rd Connects to the local machine
```
**License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html)