How can I connect to websocket in C # with Windows 7?

I just started to learn examples of connecting to websocket in C # and realized that they all use .NET 4.5. I am using Visual Studio 2010 on Windows 7 - are there any examples or libraries for this?

+4
source share
3 answers

As a result, I used websocket-sharp - it is very easy to create and use.

+4
source
+2
source

You cannot host web sockets in IIS 7.5, but you can host your own web server using Fleck

You can download it from github or fleck type in nuget.

Create your web server socket

// Create Websocket server websocketServer = new Fleck.WebSocketServer("ws://localhost:82"); websocketServer.Start(socket => { socket.OnOpen = () => Console.WriteLine("Open!"); socket.OnClose = () => Console.WriteLine("Close!"); socket.OnMessage = message => socket.Send(message); }); 
+2
source

Source: https://habr.com/ru/post/1437713/


All Articles