mosca mqtt服务器接收 websocket客户端消息

kevin.Zhu 发布于:2018-4-26 17:37 分类:文摘  有 20 人浏览,获得评论 0 条  

https://github.com/mcollina/mosca/issues/655


配置mosca文件, 使它支持多种协议


const moscaSetting = {
interfaces: [
{ type: "mqtt", port: 1883 },
{ type: "mqtts", port: 8883, credentials: { keyPath: SECURE_KEY, certPath: SECURE_CERT } },
{ type: "http", port: 3000, bundle: true },
{ type: "https", port: 3001, bundle: true, credentials: { keyPath: SECURE_KEY, certPath: SECURE_CERT } }
],
secure : {
keyPath: SECURE_KEY,
certPath: SECURE_CERT,
},
stats: false,
onQoS2publish: 'noack', // can set to 'disconnect', or to 'dropToQoS1' if using a client which will eat puback for QOS 2; e.g. mqtt.js