At the moment I am using REST to consume data from external services/servers using my console app, but it's not very real time.
Can anyone provide a very basic working example of how I can connect a .net core console app to wss://echo.websocket.org
?
I have started with:
using System;
using System.Net.WebSockets;
namespace websocket
{
class Program
{
static void Main(string[] args)
{
using (var ws = new WebSocket("wss://echo.websocket.org"))
{
}
}
}
}
But new WebSocket("wss://echo.websocket.org"))
shows the error Cannot create an instance of the abstract type or interface 'WebSocket' [websocket]csharp(CS0144)