This Blazor WebAssembly and ASP.NET project is a chat web application that demonstrates the use of WebSockets.
The core components of the project are located in 2 files: \Client\WebSocketClientConnection.cs
(for the client-side) and \Server\Controllers\WebSocketsController.cs
(for the server-side).
The following article will provide a comprehensive guide on implementing WebSocket into your own project using these files.
https://arvinboggs.github.io/blog/posts/blazor-websocket
Download the source code from https://github.com/arvinboggs/BlazorWebSocket.