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.

EndpointRouterExtensions.cs 524 B

123456789101112131415161718192021
  1. 
  2. #if NETCOREAPP3_1
  3. using Microsoft.AspNetCore.Builder;
  4. using Microsoft.AspNetCore.Routing;
  5. namespace MQTTnet.AspNetCore
  6. {
  7. public static class EndpointRouterExtensions
  8. {
  9. public static void MapMqtt(this IEndpointRouteBuilder endpoints, string pattern)
  10. {
  11. endpoints.MapConnectionHandler<MqttConnectionHandler>(pattern, options =>
  12. {
  13. options.WebSockets.SubProtocolSelector = MqttSubProtocolSelector.SelectSubProtocol;
  14. });
  15. }
  16. }
  17. }
  18. #endif