VueWebApi/Controllers/SendController.cs
@@ -22,7 +22,7 @@ [HttpGet] public async Task SendMsg(string msg) { await webSocket.ConnectAsync(new Uri("ws://localhost:8001"), _cancellation); await webSocket.ConnectAsync(new Uri("ws://localhost:8001"), CancellationToken.None); var sendBytes = Encoding.UTF8.GetBytes(msg);//发送的数据 var bsend = new ArraySegment<byte>(sendBytes); await webSocket.SendAsync(bsend, WebSocketMessageType.Binary, true, _cancellation);