{"id":114286,"date":"2026-10-08T20:16:48","date_gmt":"2026-10-08T12:16:48","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/114286.html"},"modified":"2026-10-08T20:16:48","modified_gmt":"2026-10-08T12:16:48","slug":"we-mp-rss-%e5%86%85%e7%bd%ae-qtserver-mqtt-%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%85%a8%e6%8c%87%e5%8d%97%ef%bc%9a%e5%9f%ba%e4%ba%8e-aedes-%e7%9a%84-tcp-websocket-%e5%8f%8c%e9%80%9a%e9%81%93%e6%b6%88","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/114286.html","title":{"rendered":"we-mp-rss \u5185\u7f6e QtServer MQTT \u670d\u52a1\u5668\u5168\u6307\u5357\uff1a\u57fa\u4e8e aedes \u7684 TCP + WebSocket \u53cc\u901a\u9053\u6d88\u606f\u4e2d\u67a2"},"content":{"rendered":"<ul class=\"gcb-tag-list\">\n<li><span class=\"gcb-tag\">\u540e\u7aef<\/span><\/li>\n<li><span class=\"gcb-tag\">\u7f51\u9875\u722c\u866b<\/span><\/li>\n<li><span class=\"gcb-tag\">\u524d\u7aef<\/span><\/li>\n<\/ul>\n<h3 class=\"gcb-project-title\">\u3010\u514d\u8d39\u4e0b\u8f7d\u94fe\u63a5\u3011we-mp-rss<\/h3>\n<p class=\"gcb-project-desc\">\u2728\u7b26\u5408\u9605\u8bfb\u4e60\u60ef\u7684\u5fae\u4fe1\u516c\u4f17\u53f7\u52a9\u624b\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u8f6cMarkDown\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u8f6cPDF\u3001\u5b9a\u65f6\u66f4\u65b0\u8ba2\u9605\u516c\u4f17\u53f7\u6587\u7ae0\u3001\u751f\u6210\u5fae\u4fe1\u516c\u4f17\u53f7RSS\u8ba2\u9605\u6e90\u3001\u5bfc\u51fa\u5fae\u4fe1\u516c\u4f17\u53f7\u8ba2\u9605\u6e90\u3001\u652f\u6301\u5fae\u4fe1\u516c\u4f17\u53f7Webhook\/\u5fae\u4fe1\u516c\u4f17\u53f7API\/AI Agent\u63a5\u5165\u5fae\u4fe1\u516c\u4f17\u53f7\u5fae\u4fe1\u516c\u4f17\u53f7\u3001\u8ba2\u9605\u5fae\u4fe1\u516c\u4f17\u53f7\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u52a9\u624b \u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u9605\u8bfb\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u63a5\u53e3\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u722c\u866b\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u76d1\u6d4b\u3001\u6807\u7b7e\u8ba2\u9605\u5fae\u4fe1\u516c\u4f17\u53f7\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u6e90\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u8bfb\u4e66\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u6587\u7ae0\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u6846\u67b6\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u7ba1\u7406\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u6e90\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u5e73\u53f0\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u4ee3\u7801\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u7cfb\u7edf\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u6e90\u7801<\/p>\n<p>    <span class=\"gcb-project-addr-label\">\u9879\u76ee\u5730\u5740&#xff1a;<\/span><br \/>\n    <span class=\"gcb-project-addr-link\">https:\/\/gitcode.com\/gh_mirrors\/we\/we-mp-rss<\/span> <\/p>\n<p>  <span class=\"gcb-project-btn\"> <span class=\"gcb-project-btn-main\">\u70b9\u51fb\u67e5\u770b<\/span> <span class=\"gcb-project-btn-sub\">\u514d\u8d39\u4e0b\u8f7d<\/span> <\/span> <\/p>\n<p>\u672c\u6587\u662f\u4e00\u4efd\u56f4\u7ed5 we-mp-rss \u4ed3\u5e93 qtserver \u76ee\u5f55\u7684\u5b9e\u6218\u6280\u672f\u6307\u5357&#xff0c;\u7cfb\u7edf\u8bb2\u89e3\u4ed3\u5e93\u5185\u7f6e\u7684 Node.js MQTT \u670d\u52a1\u5668\u7684\u542f\u52a8\u3001\u914d\u7f6e\u3001\u53cc\u534f\u8bae\u5ba2\u6237\u7aef\u63a5\u5165\u3001WebSocket \u6d88\u606f API \u4e0e\u6e90\u7801\u7ea7\u8fd0\u884c\u539f\u7406&#xff0c;\u5e76\u914d\u5957\u5b8c\u6574\u7684\u81ea\u52a8\u5316\u6d4b\u8bd5\u5de5\u5177\u4f7f\u7528\u8bf4\u660e\u3002\u8bfb\u5b8c\u672c\u6587&#xff0c;\u4f60\u5c06\u638c\u63e1\u5982\u4f55\u5728\u672c\u5730\u5feb\u901f\u62c9\u8d77\u4e00\u4e2a\u540c\u65f6\u652f\u6301\u6807\u51c6 MQTT 3.1.1&#xff08;TCP 1883&#xff09;\u4e0e\u6d4f\u89c8\u5668 WebSocket&#xff08;8083&#xff09;\u7684\u6d88\u606f\u670d\u52a1\u5668&#xff0c;\u5e76\u80fd\u57fa\u4e8e\u4ed3\u5e93\u6e90\u7801\u7406\u89e3\u5176\u8ba2\u9605\u53d1\u5e03\u3001\u6d88\u606f\u6301\u4e45\u5316\u4e0e\u5e7f\u64ad\u8f6c\u53d1\u7684\u5e95\u5c42\u5b9e\u73b0\u3002<\/p>\n<h3>\u4e00\u3001\u9879\u76ee\u5b9a\u4f4d&#xff1a;\u4ed3\u5e93\u91cc\u7684\u201cMQTT \u52a9\u624b\u201d<\/h3>\n<p>qtserver\/ \u662f we-mp-rss \u9879\u76ee\u4e2d\u4e00\u4e2a\u72ec\u7acb\u3001\u53ef\u5355\u72ec\u90e8\u7f72\u7684 Node.js \u6a21\u5757&#xff0c;\u5176\u5b9a\u4f4d\u5728\u4ed3\u5e93\u7684 AGENTS.md \u4e2d\u88ab\u660e\u786e\u63cf\u8ff0\u4e3a &#034;MQTT helper&#034;&#xff0c;\u5f00\u53d1\u8005\u53ef\u901a\u8fc7 npm install \u4e0e npm run start \u5feb\u901f\u542f\u52a8&#xff08;\u89c1 AGENTS.md&#xff09;\u3002\u5b83\u4e0d\u4f9d\u8d56\u4e3b\u9879\u76ee\u7684 Python \u540e\u7aef&#xff0c;\u62e5\u6709\u72ec\u7acb\u7684\u4f9d\u8d56\u58f0\u660e\u4e0e\u542f\u52a8\u811a\u672c&#xff0c;\u9002\u5408\u5728\u9700\u8981\u5b9e\u65f6\u6d88\u606f\u63a8\u9001\u3001\u6d4f\u89c8\u5668\u4e0e\u8bbe\u5907\u95f4\u53cc\u5411\u901a\u4fe1\u3001\u4efb\u52a1\u72b6\u6001\u5e7f\u64ad\u7b49\u573a\u666f\u4e0b\u4f5c\u4e3a\u6d88\u606f\u4e2d\u67a2\u4f7f\u7528\u3002<\/p>\n<ul>\n<li>\u534f\u8bae\u5c42\u9762&#xff1a;\u652f\u6301 MQTT 3.1.1&#xff08;TCP&#xff09;\u4e0e WebSocket \u4e24\u79cd\u63a5\u5165\u65b9\u5f0f&#xff0c;\u6d4f\u89c8\u5668\u5ba2\u6237\u7aef\u65e0\u9700\u5b89\u88c5\u4efb\u4f55 MQTT \u5ba2\u6237\u7aef\u5e93\u5373\u53ef\u4f7f\u7528\u3002<\/li>\n<li>\u67b6\u6784\u5c42\u9762&#xff1a;\u57fa\u4e8e\u8f7b\u91cf\u7ea7 MQTT Broker \u5e93 aedes&#xff08;^0.51.3&#xff09;\u6784\u5efa TCP \u670d\u52a1&#xff0c;\u57fa\u4e8e ws&#xff08;^8.18.0&#xff09;\u6784\u5efa WebSocket \u670d\u52a1&#xff0c;\u5ba2\u6237\u7aef\u5e93 mqtt&#xff08;^5.0.0&#xff09;\u540c\u65f6\u5145\u5f53\u5b98\u65b9\u8fde\u63a5\u793a\u4f8b\u4e0e\u6d4b\u8bd5\u5de5\u5177&#xff08;\u89c1 package.json&#xff09;\u3002<\/li>\n<li>\u529f\u80fd\u5c42\u9762&#xff1a;\u4e3b\u9898\u8ba2\u9605\/\u53d1\u5e03\u3001\u5fc3\u8df3\u68c0\u6d4b\u3001\u591a\u5ba2\u6237\u7aef\u7ba1\u7406\u3001\u5185\u5b58\u7ea7\u6d88\u606f\u6301\u4e45\u5316\u4e0e\u5386\u53f2\u56de\u653e\u4e00\u5e94\u4ff1\u5168\u3002<\/li>\n<\/ul>\n<h3>\u4e8c\u3001\u5feb\u901f\u5f00\u59cb&#xff1a;\u4e09\u79cd\u65b9\u5f0f\u62c9\u8d77\u670d\u52a1\u5668<\/h3>\n<h4>1. \u5b89\u88c5\u4f9d\u8d56<\/h4>\n<p>\u8fdb\u5165\u6a21\u5757\u76ee\u5f55\u5b89\u88c5 Node.js \u4f9d\u8d56&#xff1a;<\/p>\n<p>cd qtserver<br \/>\nnpm install<\/p>\n<p>\u4f9d\u8d56\u9879\u5305\u542b\u4e09\u4e2a\u8fd0\u884c\u65f6\u5e93\u4e0e\u4e00\u4e2a\u5f00\u53d1\u5de5\u5177&#xff08;\u89c1 package.json&#xff09;&#xff1a;<\/p>\n<table>\n<tr>\u5305\u540d\u7248\u672c\u7ea6\u675f\u4f5c\u7528<\/tr>\n<tbody>\n<tr>\n<td>aedes<\/td>\n<td>^0.51.3<\/td>\n<td>MQTT Broker \u6838\u5fc3&#xff0c;\u8d1f\u8d23 MQTT 3.1.1 \u534f\u8bae\u7684\u89e3\u6790\u4e0e\u4f1a\u8bdd\u7ba1\u7406<\/td>\n<\/tr>\n<tr>\n<td>mqtt<\/td>\n<td>^5.0.0<\/td>\n<td>MQTT \u5ba2\u6237\u7aef\u5e93&#xff0c;\u7528\u4e8e\u8fde\u63a5\u793a\u4f8b\u4e0e\u6d4b\u8bd5\u811a\u672c<\/td>\n<\/tr>\n<tr>\n<td>ws<\/td>\n<td>^8.18.0<\/td>\n<td>WebSocket \u5b9e\u73b0&#xff0c;\u670d\u52a1\u7aef\u4e0e\u6d4b\u8bd5\u7aef\u5747\u4f7f\u7528<\/td>\n<\/tr>\n<tr>\n<td>nodemon<\/td>\n<td>^3.1.7&#xff08;dev&#xff09;<\/td>\n<td>\u5f00\u53d1\u6a21\u5f0f\u81ea\u52a8\u91cd\u542f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>2. \u542f\u52a8\u670d\u52a1\u5668<\/h4>\n<p>\u5b98\u65b9\u63d0\u4f9b\u4e09\u79cd\u542f\u52a8\u65b9\u5f0f&#xff08;\u89c1 README.md&#xff09;&#xff1a;<\/p>\n<p># \u65b9\u5f0f1: \u4f7f\u7528npm\u811a\u672c&#xff08;\u7b49\u4ef7\u4e8e node mqtt-server.js&#xff09;<br \/>\nnpm start<\/p>\n<p># \u65b9\u5f0f2: \u76f4\u63a5\u8fd0\u884c<br \/>\nnode mqtt-server.js<\/p>\n<p># \u65b9\u5f0f3: \u4f7f\u7528\u6279\u5904\u7406\u6587\u4ef6&#xff08;Windows&#xff09;<br \/>\nstart.bat<\/p>\n<p>\u5176\u4e2d start.bat \u4f1a\u5728\u542f\u52a8\u524d\u81ea\u52a8\u5b8c\u6210\u4e09\u4ef6\u4e8b&#xff1a;\u6821\u9a8c Node.js \u662f\u5426\u5b89\u88c5&#xff08;\u7f3a\u5931\u65f6\u62a5\u9519\u9000\u51fa&#xff09;\u3001\u68c0\u67e5 node_modules \u662f\u5426\u5b58\u5728&#xff08;\u4e0d\u5b58\u5728\u5219\u81ea\u52a8\u6267\u884c npm install&#xff09;\u3001\u6700\u540e\u542f\u52a8 mqtt-server.js\u3002\u82e5\u65e5\u5e38\u5f00\u53d1\u9700\u8981\u70ed\u91cd\u8f7d&#xff0c;package.json \u8fd8\u63d0\u4f9b\u4e86 npm run dev&#xff08;\u7b49\u4ef7\u4e8e nodemon mqtt-server.js&#xff09;\u3002<\/p>\n<p>\u542f\u52a8\u6210\u529f\u540e\u63a7\u5236\u53f0\u4f1a\u8f93\u51fa\u4e24\u6761\u76d1\u542c\u4fe1\u606f&#xff1a;<\/p>\n<p>MQTT\u670d\u52a1\u5668\u76d1\u542c\u7aef\u53e3 1883<br \/>\nWebSocket MQTT\u670d\u52a1\u5668\u76d1\u542c\u7aef\u53e3 8083<\/p>\n<h4>3. \u53ef\u9009\u73af\u5883\u53d8\u91cf\u914d\u7f6e<\/h4>\n<p>\u670d\u52a1\u5668\u5728\u5b9e\u4f8b\u5316\u65f6\u8bfb\u53d6\u73af\u5883\u53d8\u91cf\u4f5c\u4e3a\u7aef\u53e3\u914d\u7f6e&#xff08;\u5bf9\u5e94\u6e90\u7801 mqtt-server.js&#xff09;&#xff1a;<\/p>\n<p># MQTT\u7aef\u53e3&#xff08;\u9ed8\u8ba41883&#xff09;<br \/>\nexport MQTT_PORT&#061;1883<\/p>\n<p># WebSocket\u7aef\u53e3&#xff08;\u9ed8\u8ba48083&#xff09;<br \/>\nexport WS_PORT&#061;8083<\/p>\n<p>\u7aef\u53e3\u8bf4\u660e&#xff1a;MQTT \u7aef\u53e3 1883 \u662f\u6807\u51c6 MQTT \u534f\u8bae\u7aef\u53e3&#xff0c;\u4f9b\u5404\u7c7b MQTT \u5ba2\u6237\u7aef\u901a\u8fc7 TCP \u76f4\u8fde&#xff1b;WebSocket \u7aef\u53e3 8083 \u4f9b\u6d4f\u89c8\u5668\u7b49 Web \u5ba2\u6237\u7aef\u5efa\u7acb ws:\/\/ \u8fde\u63a5\u3002\u4e24\u4e2a\u7aef\u53e3\u72ec\u7acb\u76d1\u542c&#xff0c;\u4e92\u4e0d\u5f71\u54cd\u3002<\/p>\n<h3>\u4e09\u3001\u53cc\u534f\u8bae\u5ba2\u6237\u7aef\u63a5\u5165\u793a\u4f8b<\/h3>\n<h4>3.1 \u6807\u51c6 MQTT \u5ba2\u6237\u7aef&#xff08;Node.js \/ \u5d4c\u5165\u5f0f\u8bbe\u5907&#xff09;<\/h4>\n<p>\u4f7f\u7528 mqtt \u5ba2\u6237\u7aef\u5e93\u8fde\u63a5 1883 \u7aef\u53e3&#xff0c;\u5373\u53ef\u5b8c\u6210\u8ba2\u9605\u3001\u53d1\u5e03\u4e0e\u6d88\u606f\u63a5\u6536&#xff08;\u793a\u4f8b\u53d6\u81ea README.md&#xff0c;\u53ef\u76f4\u63a5\u590d\u5236\u8fd0\u884c&#xff09;&#xff1a;<\/p>\n<p>const mqtt &#061; require(&#039;mqtt&#039;);<\/p>\n<p>\/\/ \u8fde\u63a5\u5230MQTT\u670d\u52a1\u5668<br \/>\nconst client &#061; mqtt.connect(&#039;mqtt:\/\/localhost:1883&#039;);<\/p>\n<p>client.on(&#039;connect&#039;, () &#061;&gt; {<br \/>\n    console.log(&#039;\u8fde\u63a5\u6210\u529f&#039;);<\/p>\n<p>    \/\/ \u8ba2\u9605\u4e3b\u9898<br \/>\n    client.subscribe(&#039;test\/topic&#039;);<\/p>\n<p>    \/\/ \u53d1\u5e03\u6d88\u606f<br \/>\n    client.publish(&#039;test\/topic&#039;, &#039;Hello MQTT!&#039;);<br \/>\n});<\/p>\n<p>client.on(&#039;message&#039;, (topic, message) &#061;&gt; {<br \/>\n    console.log(&#096;\u6536\u5230\u6d88\u606f: ${topic} &#8211; ${message.toString()}&#096;);<br \/>\n});<\/p>\n<h4>3.2 WebSocket \u5ba2\u6237\u7aef&#xff08;\u6d4f\u89c8\u5668\u7aef&#xff09;<\/h4>\n<p>\u6d4f\u89c8\u5668\u76f4\u63a5\u4f7f\u7528\u539f\u751f WebSocket \u8fde\u63a5 8083 \u7aef\u53e3\u5373\u53ef&#xff0c;\u65e0\u9700\u5f15\u5165\u4efb\u4f55\u4f9d\u8d56&#xff1a;<\/p>\n<p>\/\/ \u6d4f\u89c8\u5668\u7aefJavaScript<br \/>\nconst ws &#061; new WebSocket(&#039;ws:\/\/localhost:8083&#039;);<\/p>\n<p>ws.onopen &#061; () &#061;&gt; {<br \/>\n    console.log(&#039;WebSocket\u8fde\u63a5\u6210\u529f&#039;);<\/p>\n<p>    \/\/ \u8ba2\u9605\u4e3b\u9898<br \/>\n    ws.send(JSON.stringify({<br \/>\n        type: &#039;subscribe&#039;,<br \/>\n        topic: &#039;test\/topic&#039;<br \/>\n    }));<\/p>\n<p>    \/\/ \u53d1\u5e03\u6d88\u606f<br \/>\n    ws.send(JSON.stringify({<br \/>\n        type: &#039;publish&#039;,<br \/>\n        topic: &#039;test\/topic&#039;,<br \/>\n        payload: &#039;Hello from WebSocket!&#039;<br \/>\n    }));<br \/>\n};<\/p>\n<p>ws.onmessage &#061; (event) &#061;&gt; {<br \/>\n    const data &#061; JSON.parse(event.data);<br \/>\n    if (data.type &#061;&#061;&#061; &#039;message&#039;) {<br \/>\n        console.log(&#096;\u6536\u5230\u6d88\u606f: ${data.topic} &#8211; ${data.payload}&#096;);<br \/>\n    }<br \/>\n};<\/p>\n<p>\u5efa\u7acb\u8fde\u63a5\u540e\u670d\u52a1\u5668\u4f1a\u9996\u5148\u63a8\u9001\u4e00\u6761 connected \u6d88\u606f&#xff08;\u542b\u670d\u52a1\u5668\u5206\u914d\u7684 clientId&#xff09;&#xff0c;\u8ba2\u9605\u6210\u529f\u540e\u63a8\u9001 suback&#xff0c;\u53d1\u5e03\u6210\u529f\u540e\u63a8\u9001 puback&#xff0c;\u4e1a\u52a1\u6d88\u606f\u4ee5 message \u7c7b\u578b\u4e0b\u53d1\u2014\u2014\u8fd9\u4e9b\u7531\u670d\u52a1\u7aef handleWebSocketMessage \u4e0e\u8fde\u63a5\u56de\u8c03\u4fdd\u8bc1&#xff08;\u89c1 mqtt-server.js&#xff09;\u3002<\/p>\n<h3>\u56db\u3001WebSocket \u6d88\u606f\u534f\u8bae\u8be6\u89e3<\/h3>\n<p>\u670d\u52a1\u7aef\u5bf9 WebSocket \u5e27\u7edf\u4e00\u6309 JSON \u89e3\u6790&#xff0c;\u6d88\u606f\u4f53\u5fc5\u542b type \u5b57\u6bb5\u3002\u4ee5\u4e0b\u662f README.md \u5b9a\u4e49\u7684\u56db\u7c7b\u5ba2\u6237\u7aef\u8bf7\u6c42&#xff1a;<\/p>\n<table>\n<tr>type\u7528\u9014\u8bf7\u6c42\u4f53<\/tr>\n<tbody>\n<tr>\n<td>subscribe<\/td>\n<td>\u8ba2\u9605\u4e3b\u9898<\/td>\n<td>{ &#034;type&#034;: &#034;subscribe&#034;, &#034;topic&#034;: &#034;your\/topic&#034; }<\/td>\n<\/tr>\n<tr>\n<td>unsubscribe<\/td>\n<td>\u53d6\u6d88\u8ba2\u9605<\/td>\n<td>{ &#034;type&#034;: &#034;unsubscribe&#034;, &#034;topic&#034;: &#034;your\/topic&#034; }<\/td>\n<\/tr>\n<tr>\n<td>publish<\/td>\n<td>\u53d1\u5e03\u6d88\u606f<\/td>\n<td>{ &#034;type&#034;: &#034;publish&#034;, &#034;topic&#034;: &#034;your\/topic&#034;, &#034;payload&#034;: &#034;your message&#034; }<\/td>\n<\/tr>\n<tr>\n<td>ping<\/td>\n<td>\u5fc3\u8df3<\/td>\n<td>{ &#034;type&#034;: &#034;ping&#034; }<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5bf9\u5e94\u7684 JSON \u793a\u4f8b&#xff08;\u5b8c\u6574\u7ee7\u627f\u81ea\u539f\u6587\u6863&#xff09;&#xff1a;<\/p>\n<p>{<br \/>\n    &#034;type&#034;: &#034;subscribe&#034;,<br \/>\n    &#034;topic&#034;: &#034;your\/topic&#034;<br \/>\n}<\/p>\n<p>{<br \/>\n    &#034;type&#034;: &#034;unsubscribe&#034;,<br \/>\n    &#034;topic&#034;: &#034;your\/topic&#034;<br \/>\n}<\/p>\n<p>{<br \/>\n    &#034;type&#034;: &#034;publish&#034;,<br \/>\n    &#034;topic&#034;: &#034;your\/topic&#034;,<br \/>\n    &#034;payload&#034;: &#034;your message&#034;<br \/>\n}<\/p>\n<p>{<br \/>\n    &#034;type&#034;: &#034;ping&#034;<br \/>\n}<\/p>\n<p>\u9664\u4e0a\u8ff0\u8bf7\u6c42\u5916&#xff0c;\u670d\u52a1\u7aef\u8fd8\u4f1a\u5411\u4e0b\u53d1\u9001\u591a\u79cd\u54cd\u5e94\u7c7b\u578b&#xff08;\u6e90\u7801\u53ef\u8bc1&#xff0c;\u89c1 mqtt-server.js&#xff09;&#xff1a;<\/p>\n<ul>\n<li>connected&#xff1a;\u8fde\u63a5\u5efa\u7acb\u6210\u529f\u540e\u8fd4\u56de&#xff0c;\u643a\u5e26\u670d\u52a1\u5668\u5206\u914d\u7684 clientId&#xff08;\u683c\u5f0f\u4e3a ws_\u65f6\u95f4\u6233_\u968f\u673a\u4e32&#xff09;&#xff1b;<\/li>\n<li>suback \/ unsuback&#xff1a;\u8ba2\u9605\/\u53d6\u6d88\u8ba2\u9605\u7684\u786e\u8ba4\u56de\u6267&#xff0c;\u542b topic \u4e0e success \u5b57\u6bb5&#xff1b;<\/li>\n<li>puback&#xff1a;\u53d1\u5e03\u786e\u8ba4&#xff0c;\u542b topic \u4e0e success \u5b57\u6bb5&#xff1b;<\/li>\n<li>message&#xff1a;\u4e1a\u52a1\u6d88\u606f&#xff0c;\u542b topic\u3001payload\u3001timestamp\u3001clientId&#xff08;\u6765\u6e90\u5ba2\u6237\u7aef&#xff09;&#xff1b;<\/li>\n<li>pong&#xff1a;\u5bf9 ping \u5fc3\u8df3\u7684\u5e94\u7b54&#xff1b;<\/li>\n<li>error&#xff1a;JSON \u89e3\u6790\u5931\u8d25\u7b49\u5f02\u5e38\u65f6\u8fd4\u56de&#xff0c;\u643a\u5e26 message: &#034;\u6d88\u606f\u683c\u5f0f\u9519\u8bef&#034;\u3002<\/li>\n<\/ul>\n<p>\u5176\u4e2d message \u6d88\u606f\u4f53\u4e2d\u989d\u5916\u643a\u5e26\u7684 timestamp&#xff08;ISO 8601 \u683c\u5f0f&#xff09;\u4e0e clientId \u5b57\u6bb5&#xff0c;\u6765\u81ea\u670d\u52a1\u7aef\u6301\u4e45\u5316\u65f6\u7684\u8bb0\u5f55&#xff08;\u89c1 mqtt-server.js&#xff09;\u3002<\/p>\n<h3>\u4e94\u3001\u670d\u52a1\u5668\u7ba1\u7406<\/h3>\n<p>\u670d\u52a1\u5668\u542f\u52a8\u540e\u63d0\u4f9b\u4e24\u79cd\u5173\u95ed\u65b9\u5f0f&#xff08;\u89c1 README.md \u4e0e mqtt-server.js&#xff09;&#xff1a;<\/p>\n<ul>\n<li>Ctrl&#043;C&#xff1a;\u5728\u7ec8\u7aef\u524d\u53f0\u8fd0\u884c\u65f6\u4f18\u96c5\u5173\u95ed&#xff1b;<\/li>\n<li>SIGINT \/ SIGTERM&#xff1a;\u8fdb\u7a0b\u4fe1\u53f7\u5173\u95ed&#xff0c;\u9002\u7528\u4e8e kill \u547d\u4ee4\u6216\u5bb9\u5668\u5316\u90e8\u7f72\u65f6\u7684\u505c\u6b62\u6d41\u7a0b\u3002<\/li>\n<\/ul>\n<p>\u4e24\u79cd\u4fe1\u53f7\u5747\u6ce8\u518c\u4e86\u7edf\u4e00\u5904\u7406\u5668&#xff1a;\u6253\u5370 &#034;\u6536\u5230 SIGINT\/SIGTERM \u4fe1\u53f7&#xff0c;\u6b63\u5728\u5173\u95ed\u670d\u52a1\u5668&#8230;&#034; \u540e\u4f9d\u6b21\u6267\u884c server.close()&#xff08;TCP&#xff09;\u3001aedes.close()&#xff08;MQTT Broker&#xff09;\u3001wsServer.close()&#xff08;WebSocket&#xff09;&#xff0c;\u6700\u540e\u4ee5\u9000\u51fa\u7801 0 \u7ed3\u675f\u8fdb\u7a0b&#xff08;\u89c1 mqtt-server.js&#xff09;\u3002<\/p>\n<h3>\u516d\u3001\u6545\u969c\u6392\u9664<\/h3>\n<h4>\u7aef\u53e3\u88ab\u5360\u7528<\/h4>\n<p>\u82e5 1883 \u6216 8083 \u88ab\u5360\u7528&#xff0c;\u4f18\u5148\u4fee\u6539\u73af\u5883\u53d8\u91cf MQTT_PORT \/ WS_PORT \u91cd\u65b0\u6307\u5b9a\u7aef\u53e3&#xff1b;\u82e5\u9700\u5f7b\u5e95\u6539\u7aef\u53e3&#xff0c;\u4e5f\u53ef\u76f4\u63a5\u4fee\u6539 mqtt-server.js \u4e2d\u7684\u9ed8\u8ba4\u503c\u3002\u6ce8\u610f\u4fee\u6539\u6e90\u7801\u540e WebSocket \u5ba2\u6237\u7aef\u8fde\u63a5\u5730\u5740\u4e0e MQTT \u5ba2\u6237\u7aef\u8fde\u63a5\u5730\u5740\u9700\u540c\u6b65\u66f4\u65b0\u3002<\/p>\n<h4>\u4f9d\u8d56\u5b89\u88c5\u5931\u8d25<\/h4>\n<p>\u786e\u4fdd Node.js \u7248\u672c &gt;&#061; 12.0.0&#xff08;\u539f\u6587\u6863\u58f0\u660e\u7684\u7248\u672c\u4e0b\u9650&#xff09;&#xff0c;\u5e76\u5c1d\u8bd5\u6e05\u9664 npm \u7f13\u5b58\u540e\u91cd\u88c5&#xff1a;<\/p>\n<p>npm cache clean &#8211;force<br \/>\nnpm install<\/p>\n<p>\u82e5\u4ecd\u5931\u8d25&#xff0c;\u53ef\u68c0\u67e5\u7f51\u7edc\u5bf9 npm registry \u7684\u8fde\u901a\u6027&#xff0c;\u6216\u6539\u7528\u4ed3\u5e93\u4e2d\u5df2\u751f\u6210\u7684 yarn.lock \u901a\u8fc7 yarn install \u5b89\u88c5&#xff08;\u8be5\u9501\u6587\u4ef6\u7531 yarn v1 \u751f\u6210&#xff09;\u3002<\/p>\n<h3>\u4e03\u3001\u6e90\u7801\u7ea7\u539f\u7406\u5256\u6790&#xff1a;\u4ece\u8fde\u63a5\u5efa\u7acb\u5230\u6d88\u606f\u5e7f\u64ad<\/h3>\n<p>\u672c\u8282\u57fa\u4e8e mqtt-server.js \u6df1\u5165\u8bb2\u89e3\u670d\u52a1\u5668\u5185\u90e8\u5de5\u4f5c\u673a\u5236&#xff0c;\u5e2e\u52a9\u8bfb\u8005\u7406\u89e3\u4e3a\u4f55 README \u63cf\u8ff0\u7684\u529f\u80fd\u90fd\u80fd\u6210\u7acb\u3002<\/p>\n<h4>7.1 \u53cc\u670d\u52a1\u5668\u6a21\u578b\u4e0e\u72b6\u6001\u5bb9\u5668<\/h4>\n<p>MQTTServer \u7c7b\u6784\u9020\u65f6\u9ed8\u8ba4 port &#061; 1883\u3001wsPort &#061; 8083&#xff0c;\u5e76\u521d\u59cb\u5316\u4e24\u4e2a\u6838\u5fc3\u5bb9\u5668&#xff08;mqtt-server.js&#xff09;&#xff1a;<\/p>\n<ul>\n<li>this.clients&#xff08;Map&#xff09;&#xff1a;\u4ee5 client.id \u4e3a\u952e&#xff0c;\u8ddf\u8e2a\u6240\u6709\u5df2\u8fde\u63a5\u7684 MQTT \u5ba2\u6237\u7aef&#xff1b;<\/li>\n<li>this.topics&#xff08;Map&#xff09;&#xff1a;\u4ee5\u4e3b\u9898\u540d\u4e3a\u952e&#xff0c;\u503c\u4e3a\u6d88\u606f\u6570\u7ec4&#xff0c;\u5b9e\u73b0\u5185\u5b58\u7ea7\u6d88\u606f\u6301\u4e45\u5316\u3002<\/li>\n<\/ul>\n<h4>7.2 TCP MQTT \u670d\u52a1\u7684 aedes \u96c6\u6210<\/h4>\n<p>MQTT Broker \u901a\u8fc7 aedes() \u5b9e\u4f8b\u4e0e Node \u539f\u751f net \u6a21\u5757\u7ec4\u5408\u800c\u6210&#xff08;mqtt-server.js&#xff09;&#xff1a;<\/p>\n<p>this.aedes &#061; aedes();<br \/>\nthis.server &#061; net.createServer(this.aedes.handle);<\/p>\n<p>aedes.handle \u662f\u6807\u51c6\u7684 TCP \u6d41\u5904\u7406\u5668&#xff0c;\u8d1f\u8d23\u5b8c\u6210 MQTT 3.1.1 \u534f\u8bae\u63e1\u624b\u3001\u62a5\u6587\u7f16\u89e3\u7801\u4e0e\u4f1a\u8bdd\u7ba1\u7406\u3002\u56f4\u7ed5\u5b83\u6ce8\u518c\u4e86\u4e94\u4e2a\u5173\u952e\u4e8b\u4ef6&#xff1a;<\/p>\n<table>\n<tr>aedes \u4e8b\u4ef6\u89e6\u53d1\u65f6\u673a\u670d\u52a1\u7aef\u884c\u4e3a<\/tr>\n<tbody>\n<tr>\n<td>client<\/td>\n<td>\u5ba2\u6237\u7aef\u5b8c\u6210\u8fde\u63a5<\/td>\n<td>\u8bb0\u5f55\u5230 clients Map \u5e76\u6253\u5370\u5ba2\u6237\u7aef ID<\/td>\n<\/tr>\n<tr>\n<td>clientDisconnect<\/td>\n<td>\u5ba2\u6237\u7aef\u65ad\u5f00<\/td>\n<td>\u4ece clients Map \u79fb\u9664<\/td>\n<\/tr>\n<tr>\n<td>publish<\/td>\n<td>\u6536\u5230\u53d1\u5e03\u6d88\u606f<\/td>\n<td>\u6301\u4e45\u5316\u5230 topics \u5e76\u5e7f\u64ad\u7ed9\u8ba2\u9605\u8005<\/td>\n<\/tr>\n<tr>\n<td>subscribe<\/td>\n<td>\u5ba2\u6237\u7aef\u8ba2\u9605\u4e3b\u9898<\/td>\n<td>\u8bb0\u5f55\u8ba2\u9605\u5e76\u521d\u59cb\u5316\u5bf9\u5e94\u4e3b\u9898\u7684\u5b58\u50a8\u6570\u7ec4<\/td>\n<\/tr>\n<tr>\n<td>unsubscribe<\/td>\n<td>\u5ba2\u6237\u7aef\u53d6\u6d88\u8ba2\u9605<\/td>\n<td>\u6253\u5370\u53d6\u6d88\u65e5\u5fd7<\/td>\n<\/tr>\n<tr>\n<td>clientError<\/td>\n<td>\u5ba2\u6237\u7aef\u534f\u8bae\u5f02\u5e38<\/td>\n<td>\u6253\u5370\u9519\u8bef\u8be6\u60c5<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u503c\u5f97\u6ce8\u610f\u7684\u662f&#xff0c;publish \u5904\u7406\u5668\u5728\u5e7f\u64ad\u524d\u4f1a\u628a\u6d88\u606f\u8fde\u540c timestamp\u3001clientId \u4e00\u8d77\u538b\u5165\u4e3b\u9898\u6570\u7ec4&#xff08;mqtt-server.js&#xff09;&#xff0c;\u8fd9\u6b63\u662f\u201c\u6d88\u606f\u6301\u4e45\u5316\u5b58\u50a8\u201d\u529f\u80fd\u7684\u5b9e\u73b0\u6765\u6e90\u3002<\/p>\n<h4>7.3 WebSocket \u670d\u52a1\u7684\u6865\u63a5\u8bbe\u8ba1<\/h4>\n<p>WebSocket \u670d\u52a1&#xff08;mqtt-server.js&#xff09;\u4e3a\u6bcf\u4e2a\u8fde\u63a5\u5bf9\u8c61\u9644\u52a0\u4e86\u4e24\u4e2a\u81ea\u5b9a\u4e49\u5c5e\u6027&#xff1a;<\/p>\n<ul>\n<li>ws.clientId&#xff1a;\u5f62\u5982 ws_\u65f6\u95f4\u6233_9\u4f4d\u968f\u673a\u4e32 \u7684\u5168\u5c40\u552f\u4e00\u6807\u8bc6&#xff1b;<\/li>\n<li>ws.subscriptions&#xff1a;\u4e00\u4e2a Set&#xff0c;\u8bb0\u5f55\u8be5\u6d4f\u89c8\u5668\u5ba2\u6237\u7aef\u8ba2\u9605\u7684\u4e3b\u9898\u3002<\/li>\n<\/ul>\n<p>handleWebSocketMessage \u6309 data.type \u5206\u53d1\u5904\u7406&#xff08;mqtt-server.js&#xff09;&#xff1a;<\/p>\n<ul>\n<li>subscribe&#xff1a;\u52a0\u5165 ws.subscriptions&#xff0c;\u56de suback&#xff0c;\u5e76\u7acb\u5373\u91cd\u653e\u8be5\u4e3b\u9898\u7684\u5386\u53f2\u6d88\u606f\u2014\u2014\u8fd9\u662f WebSocket \u5ba2\u6237\u7aef\u53ef\u4ee5\u6536\u5230\u8ba2\u9605\u524d\u5386\u53f2\u6d88\u606f\u7684\u5173\u952e\u673a\u5236&#xff1b;<\/li>\n<li>unsubscribe&#xff1a;\u4ece ws.subscriptions \u5220\u9664\u5e76\u56de unsuback&#xff1b;<\/li>\n<li>publish&#xff1a;\u6301\u4e45\u5316\u5230 topics \u540e\u8c03\u7528 broadcastMessage&#xff0c;\u518d\u56de puback&#xff1b;<\/li>\n<li>ping&#xff1a;\u56de pong \u5b9e\u73b0\u5fc3\u8df3\u5e94\u7b54&#xff1b;<\/li>\n<li>default&#xff1a;\u6253\u5370\u672a\u77e5\u6d88\u606f\u7c7b\u578b\u544a\u8b66\u3002<\/li>\n<\/ul>\n<h4>7.4 \u8de8\u534f\u8bae\u5e7f\u64ad&#xff1a;\u4e00\u6b21\u53d1\u5e03\u3001\u4e24\u7aef\u9001\u8fbe<\/h4>\n<p>broadcastMessage(topic, payload, fromClientId)&#xff08;mqtt-server.js&#xff09;\u662f\u670d\u52a1\u5668\u8fde\u901a\u6027\u7684\u67a2\u7ebd&#xff1a;<\/p>\n<li>\u8c03\u7528 this.aedes.publish({ topic, payload, qos: 0 })&#xff0c;\u5c06\u6d88\u606f\u6ce8\u5165 MQTT Broker&#xff0c;\u7531 aedes \u8f6c\u53d1\u7ed9\u6240\u6709\u8ba2\u9605\u8be5\u4e3b\u9898\u7684 TCP MQTT \u5ba2\u6237\u7aef&#xff08;QoS \u56fa\u5b9a\u4e3a 0&#xff0c;\u5373\u81f3\u591a\u4e00\u6b21\u6295\u9012&#xff09;&#xff1b;<\/li>\n<li>\u904d\u5386 wsServer.clients&#xff0c;\u5411 readyState &#061;&#061;&#061; OPEN \u4e14 subscriptions \u5305\u542b\u8be5\u4e3b\u9898\u3001\u4e14\u975e\u6d88\u606f\u6765\u6e90\u65b9&#xff08;clientId !&#061;&#061; fromClientId&#xff09;\u7684 WebSocket \u5ba2\u6237\u7aef\u53d1\u9001 message \u5e27\u3002<\/li>\n<p>\u56e0\u6b64&#xff0c;MQTT \u5ba2\u6237\u7aef\u53d1\u5e03\u7684\u6d88\u606f\u53ef\u4ee5\u63a8\u9001\u5230\u6d4f\u89c8\u5668\u7aef&#xff0c;\u53cd\u4e4b\u4ea6\u7136&#xff0c;\u5b9e\u73b0\u4e86\u53cc\u534f\u8bae\u5ba2\u6237\u7aef\u7684\u6d88\u606f\u4e92\u901a\u3002qos: 0 \u610f\u5473\u7740\u6d88\u606f\u4e0d\u4fdd\u8bc1\u81f3\u5c11\u4e00\u6b21\u6295\u9012&#xff0c;\u9002\u5408\u5b9e\u65f6\u72b6\u6001\u901a\u77e5\u7c7b\u573a\u666f&#xff1b;\u5982\u9700\u53ef\u9760\u6295\u9012\u53ef\u5728\u6b64\u57fa\u7840\u4e0a\u6269\u5c55 QoS \u7b49\u7ea7\u3002<\/p>\n<h4>7.5 \u53ef\u7f16\u7a0b\u6269\u5c55\u63a5\u53e3<\/h4>\n<p>MQTTServer \u7c7b\u540c\u65f6\u5bfc\u51fa\u4e86\u4e24\u4e2a\u53ef\u5728\u4e8c\u6b21\u5f00\u53d1\u4e2d\u590d\u7528\u7684 API&#xff1a;<\/p>\n<p>\/\/ \u83b7\u53d6\u670d\u52a1\u5668\u72b6\u6001<br \/>\nmqttServer.getStatus();<br \/>\n\/\/ \u8fd4\u56de { mqttClients: &lt;\u5728\u7ebfMQTT\u5ba2\u6237\u7aef\u6570&gt;, wsClients: &lt;\u5728\u7ebfWebSocket\u5ba2\u6237\u7aef\u6570&gt;,<br \/>\n\/\/        topics: [&lt;\u4e3b\u9898\u5217\u8868&gt;], totalMessages: &lt;\u7d2f\u8ba1\u6d88\u606f\u603b\u6570&gt; }<\/p>\n<p>\/\/ \u4f18\u96c5\u5173\u95ed<br \/>\nmqttServer.close();<\/p>\n<p>getStatus()&#xff08;mqtt-server.js&#xff09;\u7edf\u8ba1 clients Map\u3001wsServer.clients\u3001topics Map \u7684\u5927\u5c0f\u4e0e\u6d88\u606f\u603b\u91cf&#xff0c;\u53ef\u76f4\u63a5\u7528\u4e8e\u5065\u5eb7\u68c0\u67e5\u63a5\u53e3&#xff1b;close() \u987a\u5e8f\u5173\u95ed TCP\u3001aedes \u4e0e WebSocket \u4e09\u5957\u8d44\u6e90\u3002\u6587\u4ef6\u672b\u5c3e\u901a\u8fc7 module.exports &#061; MQTTServer \u66b4\u9732\u7c7b&#xff0c;\u4e14\u9ed8\u8ba4\u5b9e\u4f8b\u5728 require \u8be5\u6587\u4ef6\u65f6\u5373\u81ea\u52a8\u542f\u52a8\u3002<\/p>\n<h3>\u516b\u3001\u914d\u5957\u6d4b\u8bd5\u5de5\u5177&#xff1a;MQTT \u5ba2\u6237\u7aef\u81ea\u52a8\u5316\u9a8c\u8bc1<\/h3>\n<p>qtserver\/ \u76ee\u5f55\u81ea\u5e26\u5b8c\u6574\u7684\u5ba2\u6237\u7aef\u6d4b\u8bd5\u5de5\u5177&#xff0c;\u8be6\u7ec6\u8bf4\u660e\u89c1 README-TEST.md&#xff0c;\u5b9e\u73b0\u89c1 mqtt-client-test.js\u3002<\/p>\n<h4>8.1 \u4e00\u952e\u8fd0\u884c\u5b8c\u6574\u6d4b\u8bd5<\/h4>\n<p># \u5148\u542f\u52a8\u670d\u52a1\u5668<br \/>\nnpm start<\/p>\n<p># \u53e6\u5f00\u7ec8\u7aef\u8fd0\u884c\u5b8c\u6574\u6d4b\u8bd5<br \/>\nnode mqtt-client-test.js<\/p>\n<p>\u6d4b\u8bd5\u5c06\u4f9d\u6b21\u6267\u884c\u4e09\u7c7b\u7528\u4f8b&#xff08;\u89c1 mqtt-client-test.js&#xff09;&#xff1a;<\/p>\n<li>MQTT \u8fde\u63a5\u6d4b\u8bd5&#xff1a;\u5efa\u7acb TCP \u8fde\u63a5\u5e76\u9a8c\u8bc1\u8fde\u63a5\u72b6\u6001&#xff08;testMQTTConnection&#xff09;&#xff1b;<\/li>\n<li>MQTT \u6d88\u606f\u6d4b\u8bd5&#xff1a;\u8ba2\u9605 test\/topic \u2192 \u53d1\u5e03\u6d4b\u8bd5\u6d88\u606f \u2192 \u6821\u9a8c\u6536\u5230 \u2192 \u53d6\u6d88\u8ba2\u9605&#xff08;testMQTTMessaging&#xff09;&#xff1b;<\/li>\n<li>WebSocket MQTT \u6d4b\u8bd5&#xff1a;\u8fde\u63a5 8083 \u2192 \u8ba2\u9605 test\/ws\/topic \u2192 \u53d1\u5e03 \u2192 \u6536\u5230 \u2192 \u53d6\u6d88\u8ba2\u9605&#xff08;testWebSocketMQTT &#043; testWebSocketMessaging&#xff09;\u3002<\/li>\n<p>\u6d4b\u8bd5\u5168\u7a0b\u5185\u7f6e\u8d85\u65f6\u4fdd\u62a4&#xff08;\u6d88\u606f\u63a5\u6536\u8d85\u65f6 5 \u79d2\u5224\u5b9a\u5931\u8d25&#xff09;&#xff0c;\u7ed3\u675f\u540e\u81ea\u52a8\u6e05\u7406 MQTT \u4e0e WebSocket \u8fde\u63a5&#xff0c;\u5e76\u6c47\u603b\u8f93\u51fa\u603b\u6d4b\u8bd5\u6570\u3001\u901a\u8fc7\u6570\u3001\u5931\u8d25\u6570\u53ca\u9010\u9879\u660e\u7ec6&#xff08;mqtt-client-test.js&#xff09;\u3002<\/p>\n<h4>8.2 \u6309\u9700\u5355\u72ec\u6d4b\u8bd5\u4e0e\u81ea\u5b9a\u4e49\u914d\u7f6e<\/h4>\n<p>MQTTClientTest \u7c7b\u66b4\u9732\u4e86\u53ef\u7ec4\u5408\u7684\u5f02\u6b65\u6d4b\u8bd5\u65b9\u6cd5&#xff0c;\u652f\u6301\u53ea\u6d4b\u67d0\u4e00\u73af\u8282&#xff1a;<\/p>\n<p>const MQTTClientTest &#061; require(&#039;.\/mqtt-client-test&#039;);<\/p>\n<p>\/\/ \u521b\u5efa\u6d4b\u8bd5\u5ba2\u6237\u7aef<br \/>\nconst testClient &#061; new MQTTClientTest({<br \/>\n    host: &#039;localhost&#039;,    \/\/ MQTT\u670d\u52a1\u5668\u5730\u5740<br \/>\n    port: 1883,           \/\/ MQTT\u7aef\u53e3<br \/>\n    wsPort: 8083,         \/\/ WebSocket\u7aef\u53e3<br \/>\n    clientId: &#039;my_test_client&#039;<br \/>\n});<\/p>\n<p>\/\/ \u53ea\u6d4b\u8bd5MQTT\u8fde\u63a5<br \/>\nawait testClient.testMQTTConnection();<\/p>\n<p>\/\/ \u53ea\u6d4b\u8bd5MQTT\u6d88\u606f\u6536\u53d1<br \/>\nawait testClient.testMQTTMessaging();<\/p>\n<p>\/\/ \u53ea\u6d4b\u8bd5WebSocket MQTT<br \/>\nawait testClient.testWebSocketMQTT();<\/p>\n<p>\/\/ \u8fd0\u884c\u6240\u6709\u6d4b\u8bd5<br \/>\nawait testClient.runAllTests();<\/p>\n<p>\u6784\u9020\u51fd\u6570\u9ed8\u8ba4\u503c\u5206\u522b\u4e3a localhost\u30011883\u30018083 \u4e0e test_client_\u65f6\u95f4\u6233&#xff08;mqtt-client-test.js&#xff09;&#xff0c;\u8fde\u63a5\u53c2\u6570\u540c\u65f6\u652f\u6301\u81ea\u5b9a\u4e49&#xff1a;<\/p>\n<p>const testClient &#061; new MQTTClientTest({<br \/>\n    host: &#039;192.168.1.100&#039;,  \/\/ \u81ea\u5b9a\u4e49\u670d\u52a1\u5668\u5730\u5740<br \/>\n    port: 8883,             \/\/ \u81ea\u5b9a\u4e49MQTT\u7aef\u53e3<br \/>\n    wsPort: 8884,           \/\/ \u81ea\u5b9a\u4e49WebSocket\u7aef\u53e3<br \/>\n    clientId: &#039;custom_client_id&#039;<br \/>\n});<\/p>\n<h4>8.3 \u6d4b\u8bd5\u524d\u7f6e\u6761\u4ef6<\/h4>\n<p>\u8fd0\u884c\u6d4b\u8bd5\u524d\u8bf7\u786e\u8ba4&#xff1a;MQTT \u670d\u52a1\u5668\u5df2\u542f\u52a8&#xff1b;\u76ee\u6807\u4e3b\u673a\u4e0e\u7aef\u53e3\u53ef\u4ece\u6d4b\u8bd5\u7aef\u8bbf\u95ee&#xff1b;\u9632\u706b\u5899\u653e\u884c 1883\/8083 \u7aef\u53e3&#xff1b;\u4f9d\u8d56\u5305\u5b89\u88c5\u5b8c\u6574\u3002\u82e5\u6d4b\u8bd5\u5931\u8d25&#xff0c;\u8f93\u51fa\u4e2d\u4f1a\u660e\u786e\u6807\u6ce8\u662f\u8fde\u63a5\u5931\u8d25\u3001\u8ba2\u9605\u5931\u8d25\u3001\u53d1\u5e03\u5931\u8d25\u8fd8\u662f\u6d88\u606f\u63a5\u6536\u8d85\u65f6&#xff0c;\u53ef\u636e\u6b64\u5b9a\u4f4d\u95ee\u9898\u3002<\/p>\n<h3>\u4e5d\u3001\u5c0f\u7ed3<\/h3>\n<p>qtserver \u4e3a we-mp-rss \u63d0\u4f9b\u4e86\u4e00\u5957\u5f00\u7bb1\u5373\u7528\u7684\u53cc\u534f\u8bae MQTT \u6d88\u606f\u4e2d\u67a2&#xff1a;TCP \u4fa7\u7531 aedes \u652f\u6491\u6807\u51c6 MQTT 3.1.1&#xff0c;WebSocket \u4fa7\u7531 ws \u652f\u6491\u6d4f\u89c8\u5668\u76f4\u8fde&#xff0c;\u4e24\u8005\u901a\u8fc7 topics \u6301\u4e45\u5316\u5bb9\u5668\u4e0e broadcastMessage \u5b8c\u6210\u8de8\u534f\u8bae\u6d88\u606f\u4e92\u901a\u3002\u539f\u6587\u6863\u4e2d\u7684\u542f\u52a8\u65b9\u5f0f\u3001\u73af\u5883\u53d8\u91cf\u3001\u5ba2\u6237\u7aef\u793a\u4f8b\u3001\u6d88\u606f\u534f\u8bae\u4e0e\u6545\u969c\u6392\u67e5\u5747\u53ef\u76f4\u63a5\u7167\u7528&#xff0c;\u800c\u6e90\u7801\u7ea7\u7ec6\u8282&#xff08;\u4e8b\u4ef6\u9a71\u52a8\u3001\u6d88\u606f\u56de\u653e\u3001QoS 0 \u5e7f\u64ad\u3001getStatus \u7edf\u8ba1&#xff09;\u5219\u4e3a\u6df1\u5ea6\u5b9a\u5236\u4e0e\u4e8c\u6b21\u5f00\u53d1\u63d0\u4f9b\u4e86\u660e\u786e\u4f9d\u636e\u3002\u6a21\u5757\u9075\u5faa MIT License&#xff08;\u89c1 README.md&#xff09;&#xff0c;\u76f8\u5173\u5b9e\u73b0\u6587\u4ef6\u4e3a mqtt-server.js\u3001mqtt-client-test.js&#xff0c;\u66f4\u591a\u6a21\u5757\u8bf4\u660e\u53ef\u53c2\u8003 README-TEST.md\u3002<\/p>\n<p>  <img loading=\"lazy\" decoding=\"async\" class=\"gcb-icon-like\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261008121647-6ac789af9e60d.svg\" alt=\"\" width=\"16\" height=\"16\" \/> <span class=\"gcb-like-text\">\u8d5e<\/span>  <\/p>\n<p>   <span class=\"gcb-share-text\">\u5206\u4eab<\/span>  <\/p>\n<ul class=\"gcb-tag-list\">\n<li><span class=\"gcb-tag\">\u540e\u7aef<\/span><\/li>\n<li><span class=\"gcb-tag\">\u7f51\u9875\u722c\u866b<\/span><\/li>\n<li><span class=\"gcb-tag\">\u524d\u7aef<\/span><\/li>\n<\/ul>\n<h3 class=\"gcb-project-title\">\u3010\u514d\u8d39\u4e0b\u8f7d\u94fe\u63a5\u3011we-mp-rss<\/h3>\n<p class=\"gcb-project-desc\">\u2728\u7b26\u5408\u9605\u8bfb\u4e60\u60ef\u7684\u5fae\u4fe1\u516c\u4f17\u53f7\u52a9\u624b\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u8f6cMarkDown\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u8f6cPDF\u3001\u5b9a\u65f6\u66f4\u65b0\u8ba2\u9605\u516c\u4f17\u53f7\u6587\u7ae0\u3001\u751f\u6210\u5fae\u4fe1\u516c\u4f17\u53f7RSS\u8ba2\u9605\u6e90\u3001\u5bfc\u51fa\u5fae\u4fe1\u516c\u4f17\u53f7\u8ba2\u9605\u6e90\u3001\u652f\u6301\u5fae\u4fe1\u516c\u4f17\u53f7Webhook\/\u5fae\u4fe1\u516c\u4f17\u53f7API\/AI Agent\u63a5\u5165\u5fae\u4fe1\u516c\u4f17\u53f7\u5fae\u4fe1\u516c\u4f17\u53f7\u3001\u8ba2\u9605\u5fae\u4fe1\u516c\u4f17\u53f7\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u52a9\u624b \u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u9605\u8bfb\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u63a5\u53e3\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u722c\u866b\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u76d1\u6d4b\u3001\u6807\u7b7e\u8ba2\u9605\u5fae\u4fe1\u516c\u4f17\u53f7\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u6e90\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u8bfb\u4e66\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u6587\u7ae0\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u6846\u67b6\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u7ba1\u7406\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u6e90\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u5e73\u53f0\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u4ee3\u7801\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u7cfb\u7edf\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u6e90\u7801<\/p>\n<p>    <span class=\"gcb-project-addr-label\">\u9879\u76ee\u5730\u5740&#xff1a;<\/span><br \/>\n    <span class=\"gcb-project-addr-link\">https:\/\/gitcode.com\/gh_mirrors\/we\/we-mp-rss<\/span> <\/p>\n<p>  <span class=\"gcb-project-btn\"> <span class=\"gcb-project-btn-main\">\u70b9\u51fb\u67e5\u770b<\/span> <span class=\"gcb-project-btn-sub\">\u514d\u8d39\u4e0b\u8f7d<\/span> <\/span> <\/p>\n<h4 class=\"gcb-related-title\">\u76f8\u5173\u63a8\u8350<\/h4>\n<ul class=\"gcb-related-list\">\n<li class=\"gcb-related-item\">\n<h5 class=\"gcb-related-item-title\">we-mp-rss \u7684 QtServer MQTT \u5ba2\u6237\u7aef\u6d4b\u8bd5\u5de5\u5177&#xff1a;\u4ece\u90e8\u7f72\u3001\u8fd0\u884c\u5230\u6d4b\u8bd5\u7ed3\u679c\u89e3\u6790<\/h5>\n<p class=\"gcb-related-item-desc\">we mp rss \u7684 QtServer MQTT \u5ba2\u6237\u7aef\u6d4b\u8bd5\u5de5\u5177&#xff1a;\u4ece\u90e8\u7f72\u3001\u8fd0\u884c\u5230\u6d4b\u8bd5\u7ed3\u679c\u89e3\u6790 \u5bfc\u8bfb qtserver \u662f we mp rss \u4ed3\u5e93\u4e2d\u4e00\u4e2a\u72ec\u7acb\u7684<\/p>\n<p>     <span class=\"gcb-tag\">\u540e\u7aef<\/span><br \/>\n     <span class=\"gcb-tag\">\u7f51\u9875\u722c\u866b<\/span><br \/>\n     <span class=\"gcb-tag\">\u524d\u7aef<\/span>\n      <\/li>\n<li class=\"gcb-related-item\">\n<h5 class=\"gcb-related-item-title\">we-mp-rss \u6d88\u606f\u4efb\u52a1 Headers \u4e0e Cookies \u8ba4\u8bc1\u914d\u7f6e\u5b8c\u5168\u6307\u5357&#xff1a;\u8ba9 WebHook \u5b89\u5168\u8c03\u7528\u53d7\u4fdd\u62a4\u63a5\u53e3<\/h5>\n<p class=\"gcb-related-item-desc\">we mp rss \u6d88\u606f\u4efb\u52a1 Headers \u4e0e Cookies \u8ba4\u8bc1\u914d\u7f6e\u5b8c\u5168\u6307\u5357&#xff1a;\u8ba9 WebHook \u5b89\u5168\u8c03\u7528\u53d7\u4fdd\u62a4\u63a5\u53e3 \u5bfc\u8bfb &#xff1a;\u672c\u6587\u4ee5 we mp rss <\/p>\n<p>     <span class=\"gcb-tag\">\u540e\u7aef<\/span><br \/>\n     <span class=\"gcb-tag\">\u7f51\u9875\u722c\u866b<\/span><br \/>\n     <span class=\"gcb-tag\">\u524d\u7aef<\/span>\n      <\/li>\n<li class=\"gcb-related-item\">\n<h5 class=\"gcb-related-item-title\">Hive \u9879\u76ee Hive Inbox \u8bbe\u8ba1\u89e3\u6790&#xff1a;\u57fa\u4e8e SSE \u53cc\u5411\u901a\u9053\u7684\u8d26\u6237\u7ea7 Sentinel \u6d88\u606f\u4e2d\u67a2<\/h5>\n<p class=\"gcb-related-item-desc\">Hive \u9879\u76ee Hive Inbox \u8bbe\u8ba1\u89e3\u6790&#xff1a;\u57fa\u4e8e SSE \u53cc\u5411\u901a\u9053\u7684\u8d26\u6237\u7ea7 Sentinel \u6d88\u606f\u4e2d\u67a2 \u5bfc\u8bfb Hive Inbox \u662f Hive&#xff08;Multi<\/p>\n<p>     <span class=\"gcb-tag\">\u4eba\u5de5\u667a\u80fd<\/span><br \/>\n     <span class=\"gcb-tag\">AI Agent<\/span><br \/>\n     <span class=\"gcb-tag\">\u591a\u667a\u80fd\u4f53<\/span><br \/>\n     <span class=\"gcb-tag\">MCP \u670d\u52a1<\/span><br \/>\n     <span class=\"gcb-tag\">\u5de5\u5177\u8c03\u7528<\/span><br \/>\n     <span class=\"gcb-tag\">\u6d4f\u89c8\u5668\u63a7\u5236<\/span>\n      <\/li>\n<\/ul>\n<p>  <span class=\"gcb-prev-next-label\">\u4e0a\u4e00\u7bc7&#xff1a;<\/span><br \/>\n  Adobe Downloader&#xff1a;macOS\u5e73\u53f0\u7ec8\u6781\u514d\u8d39\u4e0b\u8f7d\u5de5\u5177\u5b8c\u6574\u6307\u5357 <\/p>\n<p>  <span class=\"gcb-prev-next-label\">\u4e0b\u4e00\u7bc7&#xff1a;<\/span><br \/>\n  DotNext\u5199\u5165\u524d\u65e5\u5fd7(WAL)\u5b9e\u73b0\u539f\u7406\u4e0e\u6027\u80fd\u8c03\u4f18\u7ec8\u6781\u6307\u5357 <\/p>\n<p>\u521b\u4f5c\u58f0\u660e\uff1a\u672c\u6587\u90e8\u5206\u5185\u5bb9\u7531AI\u8f85\u52a9\u751f\u6210\uff08AIGC\uff09\uff0c\u4ec5\u4f9b\u53c2\u8003<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u540e\u7aef\u7f51\u9875\u722c\u866b\u524d\u7aef \u3010\u514d\u8d39\u4e0b\u8f7d\u94fe\u63a5\u3011we-mp-rss \u2728\u7b26\u5408\u9605\u8bfb\u4e60\u60ef\u7684\u5fae\u4fe1\u516c\u4f17\u53f7\u52a9\u624b\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u8f6cMarkDown\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u8f6cPDF\u3001\u5b9a\u65f6\u66f4\u65b0\u8ba2\u9605\u516c\u4f17\u53f7\u6587\u7ae0\u3001\u751f\u6210\u5fae\u4fe1\u516c\u4f17\u53f7RSS\u8ba2\u9605\u6e90\u3001\u5bfc\u51fa\u5fae\u4fe1\u516c\u4f17\u53f7\u8ba2\u9605\u6e90\u3001\u652f\u6301\u5fae\u4fe1\u516c\u4f17\u53f7Webhook\/\u5fae\u4fe1\u516c\u4f17\u53f7API\/AI Agent\u63a5\u5165\u5fae\u4fe1\u516c\u4f17\u53f7\u5fae\u4fe1\u516c\u4f17\u53f7\u3001\u8ba2\u9605\u5fae\u4fe1\u516c\u4f17\u53f7\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u52a9\u624b \u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u9605\u8bfb\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u63a5\u53e3\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u722c\u866b\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u76d1\u6d4b\u3001\u6807\u7b7e\u8ba2\u9605\u5fae\u4fe1\u516c\u4f17\u53f7\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u6e90\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u8bfb\u4e66\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u6587\u7ae0\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u6846\u67b6\u3001<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"topic":[],"class_list":["post-114286","post","type-post","status-publish","format-standard","hentry","category-server"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>we-mp-rss \u5185\u7f6e QtServer MQTT \u670d\u52a1\u5668\u5168\u6307\u5357\uff1a\u57fa\u4e8e aedes \u7684 TCP + WebSocket \u53cc\u901a\u9053\u6d88\u606f\u4e2d\u67a2 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/114286.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"we-mp-rss \u5185\u7f6e QtServer MQTT \u670d\u52a1\u5668\u5168\u6307\u5357\uff1a\u57fa\u4e8e aedes \u7684 TCP + WebSocket \u53cc\u901a\u9053\u6d88\u606f\u4e2d\u67a2 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u540e\u7aef\u7f51\u9875\u722c\u866b\u524d\u7aef \u3010\u514d\u8d39\u4e0b\u8f7d\u94fe\u63a5\u3011we-mp-rss \u2728\u7b26\u5408\u9605\u8bfb\u4e60\u60ef\u7684\u5fae\u4fe1\u516c\u4f17\u53f7\u52a9\u624b\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u8f6cMarkDown\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u8f6cPDF\u3001\u5b9a\u65f6\u66f4\u65b0\u8ba2\u9605\u516c\u4f17\u53f7\u6587\u7ae0\u3001\u751f\u6210\u5fae\u4fe1\u516c\u4f17\u53f7RSS\u8ba2\u9605\u6e90\u3001\u5bfc\u51fa\u5fae\u4fe1\u516c\u4f17\u53f7\u8ba2\u9605\u6e90\u3001\u652f\u6301\u5fae\u4fe1\u516c\u4f17\u53f7Webhook\/\u5fae\u4fe1\u516c\u4f17\u53f7API\/AI Agent\u63a5\u5165\u5fae\u4fe1\u516c\u4f17\u53f7\u5fae\u4fe1\u516c\u4f17\u53f7\u3001\u8ba2\u9605\u5fae\u4fe1\u516c\u4f17\u53f7\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u52a9\u624b \u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u9605\u8bfb\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u63a5\u53e3\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u722c\u866b\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u76d1\u6d4b\u3001\u6807\u7b7e\u8ba2\u9605\u5fae\u4fe1\u516c\u4f17\u53f7\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u6e90\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u8bfb\u4e66\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u6587\u7ae0\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u6846\u67b6\u3001\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/114286.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-08T12:16:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261008121647-6ac789af9e60d.svg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/114286.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/114286.html\",\"name\":\"we-mp-rss \u5185\u7f6e QtServer MQTT \u670d\u52a1\u5668\u5168\u6307\u5357\uff1a\u57fa\u4e8e aedes \u7684 TCP + WebSocket \u53cc\u901a\u9053\u6d88\u606f\u4e2d\u67a2 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-08T12:16:48+00:00\",\"dateModified\":\"2026-10-08T12:16:48+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/114286.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/114286.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/114286.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"we-mp-rss \u5185\u7f6e QtServer MQTT \u670d\u52a1\u5668\u5168\u6307\u5357\uff1a\u57fa\u4e8e aedes \u7684 TCP + WebSocket \u53cc\u901a\u9053\u6d88\u606f\u4e2d\u67a2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"we-mp-rss \u5185\u7f6e QtServer MQTT \u670d\u52a1\u5668\u5168\u6307\u5357\uff1a\u57fa\u4e8e aedes \u7684 TCP + WebSocket \u53cc\u901a\u9053\u6d88\u606f\u4e2d\u67a2 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/114286.html","og_locale":"zh_CN","og_type":"article","og_title":"we-mp-rss \u5185\u7f6e QtServer MQTT \u670d\u52a1\u5668\u5168\u6307\u5357\uff1a\u57fa\u4e8e aedes \u7684 TCP + WebSocket \u53cc\u901a\u9053\u6d88\u606f\u4e2d\u67a2 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u540e\u7aef\u7f51\u9875\u722c\u866b\u524d\u7aef \u3010\u514d\u8d39\u4e0b\u8f7d\u94fe\u63a5\u3011we-mp-rss \u2728\u7b26\u5408\u9605\u8bfb\u4e60\u60ef\u7684\u5fae\u4fe1\u516c\u4f17\u53f7\u52a9\u624b\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u8f6cMarkDown\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u8f6cPDF\u3001\u5b9a\u65f6\u66f4\u65b0\u8ba2\u9605\u516c\u4f17\u53f7\u6587\u7ae0\u3001\u751f\u6210\u5fae\u4fe1\u516c\u4f17\u53f7RSS\u8ba2\u9605\u6e90\u3001\u5bfc\u51fa\u5fae\u4fe1\u516c\u4f17\u53f7\u8ba2\u9605\u6e90\u3001\u652f\u6301\u5fae\u4fe1\u516c\u4f17\u53f7Webhook\/\u5fae\u4fe1\u516c\u4f17\u53f7API\/AI Agent\u63a5\u5165\u5fae\u4fe1\u516c\u4f17\u53f7\u5fae\u4fe1\u516c\u4f17\u53f7\u3001\u8ba2\u9605\u5fae\u4fe1\u516c\u4f17\u53f7\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u52a9\u624b \u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u9605\u8bfb\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u63a5\u53e3\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u722c\u866b\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u76d1\u6d4b\u3001\u6807\u7b7e\u8ba2\u9605\u5fae\u4fe1\u516c\u4f17\u53f7\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u6e90\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u8bfb\u4e66\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u6587\u7ae0\u3001\u5fae\u4fe1\u516c\u4f17\u53f7\u6846\u67b6\u3001","og_url":"https:\/\/www.wsisp.com\/helps\/114286.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-08T12:16:48+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261008121647-6ac789af9e60d.svg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/114286.html","url":"https:\/\/www.wsisp.com\/helps\/114286.html","name":"we-mp-rss \u5185\u7f6e QtServer MQTT \u670d\u52a1\u5668\u5168\u6307\u5357\uff1a\u57fa\u4e8e aedes \u7684 TCP + WebSocket \u53cc\u901a\u9053\u6d88\u606f\u4e2d\u67a2 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-08T12:16:48+00:00","dateModified":"2026-10-08T12:16:48+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/114286.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/114286.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/114286.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"we-mp-rss \u5185\u7f6e QtServer MQTT \u670d\u52a1\u5668\u5168\u6307\u5357\uff1a\u57fa\u4e8e aedes \u7684 TCP + WebSocket \u53cc\u901a\u9053\u6d88\u606f\u4e2d\u67a2"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/114286","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=114286"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/114286\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=114286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=114286"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=114286"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=114286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}