Skip to main content
Home

Built and signed on GitHub Actions

Works with
This package works with Node.js, Deno, BunIt is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
JSR Score100%
Downloads4/wk
Published3 months ago (1.2.0)

SRCDS Log Receiver for listening for UDP logs on Source Dedicated Servers

srcds-logs

Wrapper around Source Dedicated Server UDP log streams for node.

Set Up

Your server must have logs enabled. To do so, run log on in your server console or through RCON. In order to receieve messages, you must also add a log address using logaddress_add command to add the URL or IP of your server's receiver. To delete a destination, use logaddress_del.

You can always list existing addresses using logaddress_list.

Installation

See https://jsr.io/@c43721/srcds-log-receiver for more details.

Usage

You can define a receiver and listen to messages published to the UDP stream.

import { LogReceiver } from "@c43721/srcds-log-receiver";

const receiver = new LogReceiver({
  address: "0.0.0.0",
  port: 9871,
});

console.log("Log receiver running.. ");

receiver.on("event", (message) => console.log(message));

Security

In order to make this as extendable as possible, there is no built in security. However, you can mitigate this by using sv_logsecret and checking for the password in the packet. Otherwise, you can use the Socket information to determine what IPs sent the message.

Examples

For more examples, see documentation or the examples folder.

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

License

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

Built and signed on
GitHub Actions

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@c43721/srcds-log-receiver

Import symbol

import * as srcds_log_receiver from "@c43721/srcds-log-receiver";
or

Import directly with a jsr specifier

import * as srcds_log_receiver from "jsr:@c43721/srcds-log-receiver";

Add Package

pnpm i jsr:@c43721/srcds-log-receiver
or (using pnpm 10.8 or older)
pnpm dlx jsr add @c43721/srcds-log-receiver

Import symbol

import * as srcds_log_receiver from "@c43721/srcds-log-receiver";

Add Package

yarn add jsr:@c43721/srcds-log-receiver
or (using Yarn 4.8 or older)
yarn dlx jsr add @c43721/srcds-log-receiver

Import symbol

import * as srcds_log_receiver from "@c43721/srcds-log-receiver";

Add Package

vlt install jsr:@c43721/srcds-log-receiver

Import symbol

import * as srcds_log_receiver from "@c43721/srcds-log-receiver";

Add Package

npx jsr add @c43721/srcds-log-receiver

Import symbol

import * as srcds_log_receiver from "@c43721/srcds-log-receiver";

Add Package

bunx jsr add @c43721/srcds-log-receiver

Import symbol

import * as srcds_log_receiver from "@c43721/srcds-log-receiver";