Rcon.AspNetCore.Server
1.0.0
dotnet add package Rcon.AspNetCore.Server --version 1.0.0
NuGet\Install-Package Rcon.AspNetCore.Server -Version 1.0.0
<PackageReference Include="Rcon.AspNetCore.Server" Version="1.0.0" />
<PackageVersion Include="Rcon.AspNetCore.Server" Version="1.0.0" />
<PackageReference Include="Rcon.AspNetCore.Server" />
paket add Rcon.AspNetCore.Server --version 1.0.0
#r "nuget: Rcon.AspNetCore.Server, 1.0.0"
#:package Rcon.AspNetCore.Server@1.0.0
#addin nuget:?package=Rcon.AspNetCore.Server&version=1.0.0
#tool nuget:?package=Rcon.AspNetCore.Server&version=1.0.0
Rcon.AspNetCore.Server
Rcon.AspNetCore.Server is a library for building RCON (Remote Console) servers on ASP.NET Core, featuring authentication, command processing, and efficient buffer serialization.
Features
- Asynchronous RCON connection handling based on
ConnectionHandler - Client authentication and command execution via a user-provided handler
- Full support for the standard Source RCON protocol
- Flexible packet serialization/deserialization (Little Endian, UTF-8)
- Efficient buffer operations via Span/Memory and
IBufferWriter<T> - Easy integration with ASP.NET Core logging
Getting Started
Example: Handling an RCON Connection
using Microsoft.AspNetCore.Connections;
using Microsoft.Extensions.Logging;
using Rcon.AspNetCore.Server;
// Implement your custom RCON server logic
public class MyRconServer : IRconServer
{
public string Password => "my_secret_password";
public Task<string> ExecuteAsync(string command, CancellationToken cancellationToken)
{
// Your command processing logic (e.g. game server management)
return Task.FromResult($"Executed: {command}");
}
}
// Register the handler and configure Kestrel in your Startup/Program.cs
builder.Services
.AddSingleton<IRconServer, MyRconServer>();
builder.WebHost
.ConfigureKestrel(options => options
.ListenAnyIP(1234, v => v.UseConnectionHandler<RconConnectionHandler>()));
Main Types
RconConnectionHandler
Handles connections according to the RCON protocol:
- Reads and parses packets
- Authenticates clients
- Invokes commands via
IRconServer - Builds and sends responses
PacketType
Enum representing RCON packet types:
AuthRequest— Authentication requestAuthResponse— Authentication responseCommandRequest— Command execution requestCommandResponse— Command response
IRconServer
Interface for user-provided authentication and command handling:
public interface IRconServer
{
string Password { get; }
Task<string> ExecuteAsync(string command, CancellationToken cancellationToken);
}
BinaryPrimitivesExtensions, StringExtensions
Utilities for efficient serialization/deserialization of primitives and strings into buffers, optimized for network protocol handling.
Protocol Workflow
- Client connects to the server via TCP/QUIC (e.g., through Kestrel)
- Sends an authentication packet (
AuthRequest) - Upon successful authentication, client can send commands (
CommandRequest) - Server responds with results (
CommandResponse) - All packets use Little Endian byte order and UTF-8 for strings
Client Example
You can use ARRCON or other Source RCON-compatible tools for testing.
Dependencies
For integration testing, the project uses the external RCON client ARRCON, licensed under GNU GPLv3.
It is not included with the library and is used only as a separate CLI tool during test execution.
Requirements
- .NET 8.0 or later
- ASP.NET Core (Kestrel)
License
MIT
Rcon.AspNetCore.Server is a lightweight foundation for integrating RCON into your .NET servers and game projects.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- InterpolatedLogging.Microsoft.Extensions.Logging (>= 5.1.0)
- Microsoft.AspNetCore.Connections.Abstractions (>= 9.0.6)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.6)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 376 | 6/10/2025 |