[英]How to send a message from a website to an MQTT broker that does not support Websockets?
I am very new to web development and I am doing a project where I am required to send a message from my own website to Thingstream which is a MQTT broker.我对 Web 开发非常陌生,我正在做一个项目,我需要从我自己的网站向 Thingstream(一个 MQTT 代理)发送消息。 I tried to use a Javascript library called MQTT Paho to send a message to the broker but the library uses WebSocket which is not supported by Thingstream.我尝试使用名为 MQTT Paho 的 Javascript 库向代理发送消息,但该库使用了 Thingstream 不支持的 WebSocket。 The broker only supports TCP.代理仅支持 TCP。 So I now intend to use Websockify which is a library that serves as a proxy to convert a WebSocket connection to TCP.所以我现在打算使用 Websockify,它是一个用作代理将 WebSocket 连接转换为 TCP 的库。 However it is not clear to me how I would use Websockify to accomplish this.然而,我不清楚我将如何使用 Websockify 来实现这一点。 I have not been able to find sufficient documentation on how to use the library.我无法找到有关如何使用该库的足够文档。 Is it possible that someone can point out some useful documentation?有人可以指出一些有用的文档吗? Or perhaps an alternative method to do this task?或者也许是完成此任务的替代方法?
Find and using REST API:查找和使用 REST API:
Client -> REST API -> MQTT Broker -> MQTT Stream -> Client
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.