Skip to content
rcontfPublic

Repository files navigation

SRCDS RCON

Complete implementation of the Source RCON Protocol. This library works with any runtime and is not specific to any game. Supported games may include:

  • Project Zomboid
  • Rust
  • CSGO
  • Team Fortress 2
  • Minecraft
  • Palworld
  • Factorio

If there are games not listed but supports Valve's RCON protocol, it should work still. Leave a bug report if there are issues with a game.

Install

Install using jsr:

npx jsr add @c43721/rcon

For more details, checkout the jsr page.

Examples

A simple example that connects to a server and executes the status command and logs to console

using rcon = new Rcon({ host: "game.example.com", port: 27015 });

const didAuthenticate = await rcon.authenticate("myrconpassword");

console.log(didAuthenticate ? "Authenticated to the server" : "Could not authenticate");

const result = await rcon.execute("status");

console.log(result);

For more examples, see the documentation on jsr or see the cli.ts file.

Contributing

If there's a feature or bug, please raise a Github issue first alongside your PR (if you're kind enough to make a PR.)

Acknowledgements

Both of these repositories I've contributed to in the past and am super thankful for their work.

License

Distributed under the MIT License. See LICENSE for more information.

Releases

Used by

Contributors

Languages