You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
588 B
25 lines
588 B
2 years ago
|
using Microsoft.AspNetCore.Authorization;
|
||
|
using Microsoft.AspNetCore.Mvc;
|
||
|
|
||
|
namespace _24Hour.Controllers.Common
|
||
|
{
|
||
|
[Authorize]
|
||
|
public class WebSocketController : Controller
|
||
|
{
|
||
|
[HttpGet("/ws")]
|
||
|
public async Task WebSocketServer()
|
||
|
{
|
||
|
if (HttpContext.WebSockets.IsWebSocketRequest)
|
||
|
{
|
||
|
try
|
||
|
{
|
||
|
var socket = await HttpContext.WebSockets.AcceptWebSocketAsync();
|
||
|
}
|
||
|
catch (Exception ex)
|
||
|
{
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|