Creating a Web Chat with SignalR, Web Sockets, Angular and Magic

Web Sockets and asynchronous message transmissions over socket connections is probably one of the most difficult tasks you can possibly do in any web application. Hence, to make it manageable, it needs to be simplified, the same way the gearbox in your car is simple to use, even though it probably involves thousands of moving parts. In this article I will walk you through how to create a live chat client using SignalR, Web Sockets and Magic. If you wish to follow the tutorial though, the first thing you'll have to do is to download Magic.

The Angular frontend

First we'll need a frontend. Use the Angular CLI to create a new Angular project and name it "chat". Open a terminal on your development machine and execute the following command in it.

Magic Terminal over Web Sockets and SignalR

Web based terminal access is one of those crucial components to have if you truly want to build your own DIY cloud system. The first time I came to appreciate web terminals, was with Digital Ocean's droplets, which gave me a web based terminal, allowing me to directly modify my server any ways I saw fit through my browser. Golly gosh that was a najs day.

With a web terminal, you've got all of these features "for free."

Streaming in ASP.NET Core SignalR

In this post, we'll see how to stream the data in ASP.NET Core SignalR. With ASP.NET Core 2.1 released, SignalR now supports streaming content.

What Is a Stream?

Streaming or media streaming is a technique for transferring data so that it can be processed as a steady and continuous stream. - webopedia.com