Overview

We've now covered all SignalR client types that Microsoft officially supports. But what if the technology we want to use is not on the list? Also, what if there is no way to write a SignalR client, and we need to connect an existing WebSocket client to it?

The good news is that we can connect a raw WebSocket to the SignalR Hub. And once it is connected, we can easily see the structure of the messages that are being exchanged. This will allow us to write our own SignalR client implementation in any language of our choice, as WebSocket is a standard protocol, which we can write code for in any language. But today, we will focus on the .NET implementation of it.

Setting up the WebSocket client

We will create another project and call it WebSocketClient.

Get hands-on with 1400+ tech skills courses.