JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 375
  • Score
    100M100P100Q107966F
  • License MIT

A modern NodeJS library for the Source RCON Protocol

Package Exports

  • rcon-srcds

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (rcon-srcds) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

RCON library for NodeJS

According to Valve's RCON specification

Install

npm install node-srcds-rcon --save

Usage

const server = new Rcon(options);

Options

{
    host: '127.0.0.1',          // Host
    port: 27015,                // Port

    maximumPacketSize: 0,       // Maximum packet bytes (0 = no limit)
    encoding: 'ascii',          // Packet encoding (ascii, utf8)
    timeout: 1000               // ms
}

Remember you can't send a packet larger then 4096 bytes: https://developer.valvesoftware.com/wiki/Source_RCON_Protocol#Packet_Size

Example

const rcon = require('node-srcds-rcon');
const server = new Rcon({ port: 1337 });

server.authenticate('yourawesomepassword')
    .then(() => {
        console.log('Authenticated');
        return server.execute('status');
    })
    .then(console.log)
    .catch(console.error);