Class WebSocketEndpointAttribute
- Namespace
- Kuestenlogik.Bowire.Protocol.WebSocket
- Assembly
- Kuestenlogik.Bowire.Protocol.WebSocket.dll
Marks an ASP.NET Core endpoint as a WebSocket endpoint that Bowire
should expose in the sidebar. Use it on Minimal API delegates or
controller actions that perform HttpContext.WebSockets.AcceptWebSocketAsync.
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Method, AllowMultiple = false)]
public sealed class WebSocketEndpointAttribute : Attribute
- Inheritance
-
WebSocketEndpointAttribute
- Inherited Members
Examples
app.MapGet("/ws/echo", async (HttpContext ctx) =>
{
using var ws = await ctx.WebSockets.AcceptWebSocketAsync();
// ... echo loop ...
})
.WithMetadata(new WebSocketEndpointAttribute("Echo", "Echoes every message back."));
Constructors
WebSocketEndpointAttribute(string?, string?)
public WebSocketEndpointAttribute(string? displayName = null, string? description = null)
Parameters
Properties
Description
public string? Description { get; }
Property Value
DisplayName
public string? DisplayName { get; }