MQTT實戰1 - 使用Apache Apollo代理服務器實現mqtt通信
MQTT實戰3 - NetCore 2.0 + MQTTnet 3.0.9 實現mqtt通信
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
namespace MqttNetAgent
{
public class Program
{
// =====================================================================
// 運行
// NetCore 2.0 + MQTTnet 3.0.9 && MQTTnet.AspNetCore 3.0.9
// MqttNetAgent 啟動運行
// MqttClient 使用端口61615
// web 使用端口5000
// username,password為空
// =====================================================================
// 發布
// cmd
// f:
// cd F:\iot\IoTPlatform\MqttNetAgent\MqttNetAgent\bin\Debug\netcoreapp2.0
// dotnet MqttNetAgent.dll
// =====================================================================
public static void Main(string[] args)
{
BuildWebHost(args).Run();
}
public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
//.UseUrls("http://192.168.1.80:5000") // 發布地址
.UseUrls("http://127.0.0.1:5000") // 發布地址
.Build();
}
}

