Info
Version: | 1.0.0.3 |
Author(s): | JackerKun |
Last Update: | Monday, July 27, 2020 |
.NET Fiddle: | Create the first Fiddle |
NuGet Url: | https://www.nuget.org/packages/JCWebSocket |
Install
Install-Package JCWebSocket
dotnet add package JCWebSocket
paket add JCWebSocket
JCWebSocket Download (Unzip the "nupkg" after downloading)
Dependencies
- Microsoft.AspNetCore.Http.Abstractions(>= 2.2.0)
1.添加WebSocket支持
app.UseWebSockets();
2.启动WebSocket
app.Map("/ws", SocketHandler.Map);
3.第三方连接websocket
ws://ip/ws?parm=object
支持身份参数
4.查看 WebSocket连接列表
GetList()
5.清空在线列表
ClearList
6.为所有在线用户发送信息
SendTxt(text)
7.为指定参数(连接时候的parm值)用户发送消息
SendTxt(parm,text).