细节调整

This commit is contained in:
yanghongwei 2025-04-10 12:26:25 +08:00
parent a16b14bd88
commit 4bbd55f677
1 changed files with 8 additions and 1 deletions

View File

@ -11,6 +11,8 @@ using LY.App.Model;
using LY.App.MiddleWare;
using LY.App.Common.WebSocket;
using Microsoft.Extensions.FileProviders;
using Microsoft.AspNetCore.Http.Connections;
using Microsoft.Extensions.Options;
var builder = WebApplication.CreateBuilder(args);
@ -127,7 +129,12 @@ app.UseMiddleware<TokenValidationMiddleware>();
//执行匹配的端点
app.UseEndpoints(endpoints =>
{
endpoints.MapHub<SocketHub>("/websocket");
endpoints.MapHub<SocketHub>("/websocket", options =>
{
options.Transports =
HttpTransportType.WebSockets |
HttpTransportType.LongPolling;
});
endpoints.MapControllers();
});