Class WsComponent
WebSocket component. Scheme: "ws" (plain) or "wss" (TLS).
Producer: ClientWebSocket — connects to remote WebSocket server and sends frames.
Consumer: Kestrel-based WebSocket server — accepts connections and receives frames.
URI format: ws:host:port/path?messageType=Text&subProtocol=graphql-ws
public class WsComponent : ComponentBase, IComponent, IAsyncDisposable
Inheritance
Implements
Derived
Inherited Members
Properties
Authenticate
Authenticates a handshake before the socket is upgraded. Supplied by the host through
public Func<HttpContext, Task<ClaimsPrincipal?>>? Authenticate { get; set; }
Scheme
The URI scheme this component handles (e.g., "kafka", "rabbitmq").
public override string Scheme { get; }
ServerManager
Shared Kestrel host. Set by AddRedbRouteWebSocket() so ws endpoints multiplex onto
public SharedHttpServerManager? ServerManager { get; set; }
Methods
CreateEndpoint(EndpointUri)
Creates an endpoint from a parsed URI.
public override IEndpoint CreateEndpoint(EndpointUri uri)
DisposeAsync()
Releases component-owned long-lived resources. Default implementation is a no-op.
public override ValueTask DisposeAsync()
Constructors
WsComponent()
Creates the ws component. A parameterless constructor of its own: the assembly scan
WsComponent(string)
Creates a WebSocket component with the given scheme.