简体   繁体   English

在为mqtt运行WebSocket时遇到问题

[英]Having problems running WebSocket for mqtt

I'm trying to replicate this demo 我正在尝试复制此演示 演示
using my own mosquitto instance to control the meter. 使用我自己的蚊子实例来控制电表。 When I try to connect to " test.mosquitto.org", 8080 everything works great, but when I plug my own mqtt server's IP I receive: Connection failed: AMQJ0007E Socket error:undefined. 当我尝试连接到“ test.mosquitto.org", 8080一切正常,但是当我插入自己的mqtt服务器的IP时,我收到: Connection failed: AMQJ0007E Socket error:undefined.
I believe this is due to the requirement of a websocket service to run on the same machine as the mqtt. 我认为这是由于要求websocket服务必须与mqtt在同一台计算机上运行。 The original author uses WSS, and I can't figure out how to install this service (complete noob). 原始作者使用WSS,但我不知道如何安装此服务(完整的菜鸟)。 I Even tried to follow these directions with no luck Could anyone give some directions? 我什至试着没有运气遵循这些指示 ,有人可以给一些指示吗?

You can try Installing him HiveMQ while you wait for mosquito 1.4. 您可以在等待蚊子1.4时尝试为他安装HiveMQ。 That is a broker with websockets built in. 那是一个内置websockets的经纪人。

The easiest answer to this is probably to wait for Mosquitto v1.4 to ship which has baked in Websocket support. 最简单的答案可能是等待Websocket支持中发布的Mosquitto v1.4的发布。

If you can't wait for it to ship you can build from the development head stream which will get you what your looking for. 如果您迫不及待想将其发布,则可以从开发的源头进行构建,这将为您提供所需的东西。 You've not said what platform you are running the broker on, but these instructions should help on Linux: http://goochgooch.wordpress.com/2014/08/01/building-mosquitto-1-4/ 您没有说过要在哪个平台上运行代理,但是这些说明在Linux上应该有所帮助: http : //goochgooch.wordpress.com/2014/08/01/building-mosquitto-1-4/

Mosquitto v1.4已于2015年2月18日发布。它已内置对websockets的支持。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM