Skip to content

A Deno implementation for a lightweight RCON server

License

Notifications You must be signed in to change notification settings

oof2win2/rcon-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.

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).

About

A Deno implementation for a lightweight RCON server

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published