A simple Web Socket Based Application — .NET Core and Angular
Introduction
WebSocket is bi-directional, full duplex client/server communication protocol, available within browsers.
You can check more details and the browsers support on this link.
In this post, we’ll build a very simple WebSocket based client/server application. This shall help you to get started with this technology.
Basic Setup
Following is the basic setup diagram
In this simple setup, we’ll have our angular application as a websocket client and a .NET core worker application to host a websocket server.
Also, sometimes, you don’t need to build your own socket-server, instead you can use a third-party server, so, we’ll see a simple example of that too.
Lets see next, how these bits are put together.
Angular Application (Socket Client)
I built a simple angular application as follows
html is very simple and looks as follows