rcon

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package rcon talks to game servers' remote consoles.

Two protocols are supported:

  • source: Valve's Source RCON over TCP, used by Counter-Strike, Minecraft, ARK, Conan Exiles, Rust (with rcon.web 0) and many others.
  • webrcon: Facepunch's JSON-over-WebSocket RCON, Rust's default.

Index

Constants

This section is empty.

Variables

View Source
var ErrAuth = errors.New("the server rejected the RCON password")

ErrAuth means the server rejected the password.

View Source
var Protocols = []string{"source", "webrcon"}

Protocols lists the supported protocol names.

Functions

func Known

func Known(p string) bool

Known reports whether a protocol name is supported.

Types

type Client

type Client interface {
	// Exec runs one command and returns the server's reply.
	Exec(command string) (string, error)
	Close() error
}

Client is a connected, authenticated remote console.

func Dial

func Dial(o Options) (Client, error)

Dial connects and logs in.

type Options

type Options struct {
	Protocol string
	Addr     string // host:port
	Password string
	// Timeout bounds connecting and waiting for the first reply.
	Timeout time.Duration
}

Options configures a connection.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL