Path: redb-route/redb.Route.SignalR/SignalRHeaders.cs
Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route
Page: https://redbase.app/src/dev-2026-12-06/redb-route/redb.Route.SignalR/SignalRHeaders.cs
----
namespace redb.Route.SignalR;
///
/// Well-known header constants used by the SignalR component.
///
public static class SignalRHeaders
{
/// Common prefix for all SignalR component headers.
public const string Prefix = "redbSignalR.";
/// Hub method name invoked by the client or targeted by the producer.
public const string Method = "redbSignalR.Method";
/// SignalR connection identifier.
public const string ConnectionId = "redbSignalR.ConnectionId";
/// Authenticated user identifier.
public const string UserId = "redbSignalR.UserId";
/// Hub lifecycle event: "Connected" or "Disconnected".
public const string Event = "redbSignalR.Event";
/// Hub path the message was received on.
public const string HubPath = "redbSignalR.HubPath";
/// Protocol in use: "json" or "messagepack".
public const string Protocol = "redbSignalR.Protocol";
/// Whether TLS is used: "True"/"False".
public const string Ssl = "redbSignalR.Ssl";
// ── Producer targeting headers ──
/// Target audience for producer broadcast: "All", "Group", "User", "Connection".
public const string Target = "redbSignalR.Target";
/// Target group name for producer broadcast.
public const string Group = "redbSignalR.Group";
/// Target connection ID for producer send.
public const string TargetConnection = "redbSignalR.TargetConnection";
/// Target user ID for producer send.
public const string TargetUser = "redbSignalR.TargetUser";
// ── Group management headers (post-process commands) ──
/// Add the current connection to the specified group after processing.
public const string AddToGroup = "redbSignalR.AddToGroup";
/// Remove the current connection from the specified group after processing.
public const string RemoveFromGroup = "redbSignalR.RemoveFromGroup";
/// Exception message from disconnection (set on Disconnected event).
public const string DisconnectError = "redbSignalR.DisconnectError";
/// Returns true if the header key starts with the SignalR prefix.
public static bool IsRedbHeader(string key) => key.StartsWith(Prefix, StringComparison.Ordinal);
}