https://github.com/oof2win2/rcon-server
A Deno implementation for a lightweight RCON server
https://github.com/oof2win2/rcon-server
rcon server
Last synced: 12 months ago
JSON representation
A Deno implementation for a lightweight RCON server
- Host: GitHub
- URL: https://github.com/oof2win2/rcon-server
- Owner: oof2win2
- License: mit
- Created: 2022-08-23T13:30:13.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-08-27T13:44:39.000Z (almost 4 years ago)
- Last Synced: 2025-06-12T00:23:12.254Z (about 1 year ago)
- Topics: rcon, server
- Language: TypeScript
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rcon-server
A Deno implementation for an RCON server.
## Usage
Below is a simple example of how to use the RCON server to send an echo.
```ts
import Server from "https://deno.land/x/rcon_server@v1.0.1/mod.ts";
const server = new Server("localhost", 27015, "password");
server.on("request", (client, message) => {
console.log(message.body);
if (message.body.startsWith("echo ")) {
server.reply(client, message.id, message.body.substring(5));
} else {
server.reply(client, message.id, "This message is not supported yet");
}
});
```
The server will emit `unreplied` events if a message has not been replied to. This is due to the fact that the RCON protocol
*requires* messages to be replied to, even if it is with `''` (`0x00`).