using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; using MQTTnet.AspNetCore; using System.Threading.Tasks; namespace MQTTnet.TestApp.AspNetCore2 { public static class Program { public static Task Main(string[] args) { return BuildWebHost(args).RunAsync(); } private static IWebHost BuildWebHost(string[] args) => WebHost.CreateDefaultBuilder(args) .UseKestrel(o => { o.ListenAnyIP(1883, l => l.UseMqtt()); o.ListenAnyIP(5000); // default http pipeline }) .UseStartup() .Build(); } }