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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Rcon.AspNetCore.Server" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Rcon.AspNetCore.Server" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Rcon.AspNetCore.Server" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Rcon.AspNetCore.Server --version 1.0.0
                    
#r "nuget: Rcon.AspNetCore.Server, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Rcon.AspNetCore.Server@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Rcon.AspNetCore.Server&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Rcon.AspNetCore.Server&version=1.0.0
                    
Install as a Cake Tool

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 request
  • AuthResponse — Authentication response
  • CommandRequest — Command execution request
  • CommandResponse — 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

  1. Client connects to the server via TCP/QUIC (e.g., through Kestrel)
  2. Sends an authentication packet (AuthRequest)
  3. Upon successful authentication, client can send commands (CommandRequest)
  4. Server responds with results (CommandResponse)
  5. 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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 315 6/10/2025