Skip to content

RemoteServerSettings

Represents the RemoteServer configuration section used by Remote Commands. AddRemoteCommands binds this record through the package's configuration registration, and RemoteCommandHandler receives it through IOptions<RemoteServerSettings>.

Application code normally does not create this record manually. Inject IOptions<RemoteServerSettings> when a service needs to inspect the configured remote command endpoint or whitelist.

Usage

The JSON shape is documented on the configuration page. The example below shows how application services can consume the already-bound options.

csharp
using Microsoft.Extensions.Options;
using AlmightyShogun.RemoteCommands;

public sealed class RemoteCommandDiagnostics(IOptions<RemoteServerSettings> options)
{
    private readonly RemoteServerSettings _settings = options.Value;

    public string Endpoint => $"{_settings.Address}:{_settings.Port}";
}

Fields

Address: string
IP address used by the TCP listener.

Port: int
TCP port used by the remote command listener.
Default: 0

Whitelisted: string[]
Remote IP addresses allowed to connect to the listener.

EnableReceiveLog: bool
Whether the listener should log received and unknown commands.

All packages are released under the MIT License.