RCON¶
ggCON implements the Valve Source RCON protocol, compatible with any standard RCON client.
Enabling RCON¶
Add the following to your ggCON.ini:
By default, RCON binds to the same address as BindAddress. To bind RCON to a different address:
Authentication¶
RCON authentication works the same as the HTTP API:
- The client's IP must be in
AllowedIPsorAllowedCIDRs - If
RequirePassword = true, the RCON password must matchPassword
Rejected connections receive an auth failure response (id = -1) and are immediately closed.
Brute-force lockout
Five failed authentication attempts within 60 seconds locks the IP out for 5 minutes. All connection attempts from that IP are rejected during the lockout window.
Connecting with mcrcon¶
mcrcon is a command-line RCON client that works with ggCON.
Interactive session:
Single command:
Protocol details¶
ggCON implements the standard Source RCON packet format:
int32 size — byte count of the remainder
int32 id — request ID, echoed in responses
int32 type — packet type
char[] body — null-terminated UTF-8 string
char pad — second null byte
Packet types:
| Direction | Type value | Meaning |
|---|---|---|
| Client → Server | 3 |
SERVERDATA_AUTH |
| Client → Server | 2 |
SERVERDATA_EXECCOMMAND |
| Server → Client | 2 |
SERVERDATA_AUTH_RESPONSE |
| Server → Client | 0 |
SERVERDATA_RESPONSE_VALUE |
Auth flow:
- Client connects
- ggCON checks the client IP against the allowlist — if rejected, sends
AUTH_RESPONSE id=-1and closes - Client sends
SERVERDATA_AUTHwith the password in the body - ggCON checks the password — on failure, sends
AUTH_RESPONSE id=-1and closes - On success, sends
AUTH_RESPONSE id=<original request id> - Client sends
SERVERDATA_EXECCOMMANDpackets; ggCON responds withSERVERDATA_RESPONSE_VALUEcontaining the JSON result
Command responses¶
RCON commands return the same JSON as the HTTP POST /command endpoint. Parse the response body as JSON to read ok, lines, message, etc.
Limits¶
| Setting | Default | Config key |
|---|---|---|
| Maximum concurrent clients | 16 | RconMaxClients |
| Idle connection timeout | 30 seconds | RconIdleTimeoutSecs |
| Maximum packet body size | 4 096 bytes | (not configurable) |
Connections beyond RconMaxClients are rejected until an existing client disconnects. Idle connections are automatically dropped after RconIdleTimeoutSecs to prevent automation tools from exhausting connection slots.