Fleck - WebSocket 服务器


MIT
Windows
C#

软件简介

Fleck 是 C# 实现的 WebSocket 服务器。

示例代码:

var server = new WebSocketServer("ws://localhost:8181");
server.Start(socket =>
  {
    socket.OnOpen = () => Console.WriteLine("Open!");
    socket.OnClose = () => Console.WriteLine("Close!");
    socket.OnMessage = message => socket.Send(message);
  });

安全的 WebSocket:

var server = new WebSocketServer("wss://localhost:8431");
server.Certificate = new X509Certificate2("MyCert.pfx");
server.Start(socket =>
  {
    //...use as normal
  });