我正在尝试基于websocket的简单MQTT客户端,并且在Chrome控制台上出现"Uncaught ReferenceError:Messaging is defined defined"错误.
Example Web Messaging web page.
ERROR在线"var client = new Messaging.Client(wsbroker,wsport,"
错误操作系统"未捕获的ReferenceError:未定义消息"
java脚本来自http://git.eclipse.org/c/paho/org.eclipse.paho.mqtt.Javascript.git/tree/src/mqttws31.js
请建议任何解决方案......
您正在使用一个旧示例,包名已更改它不再是Messaging应该是:
... var client = new Paho.MQTT.Client(wsbroker, wsport, "myclientid_" + parseInt(Math.random() * 100, 10)); ...
编辑:test.mosquitto.org的端口号也是8080而不是80