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.
 
 
 
 

22 lines
524 B

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