MOSQUITO 1.4.2 Websocket支架

MOSQUITO 1.4.2 Websocket支架,websocket,mqtt,iot,broker,mosquitto,Websocket,Mqtt,Iot,Broker,Mosquitto,我正试图利用MOSQUITOS的最新更新来支持代理中的WebSocket。我正在运行mosquittov1.4.2,并已将以下行添加到Mosquitto配置文件(Mosquitto.conf): 当我尝试使用新配置启动代理时,我得到以下结果: $ mosquitto -c /etc/mosquitto/mosquitto.conf Error: Websockets support not available. Error found at /etc/mosquitto/mosquitto.co

我正试图利用MOSQUITOS的最新更新来支持代理中的WebSocket。我正在运行mosquittov1.4.2,并已将以下行添加到Mosquitto配置文件(Mosquitto.conf):

当我尝试使用新配置启动代理时,我得到以下结果:

$ mosquitto -c /etc/mosquitto/mosquitto.conf
Error: Websockets support not available.
Error found at /etc/mosquitto/mosquitto.conf:16.
Error: Unable to open configuration file.
我假设Mosquitto的1.4及以上版本现在有websocket支持(不必像v1.4之前那样从源代码构建来支持websocket),所以我想知道我缺少了什么。任何关于故障排除方向的帮助都将不胜感激


编辑:忘了提到我正在运行CentOS6,而1.4.x代码库包含Websocket支持,它必须在构建时启用,并且依赖于libwebsocket库

RedHat/Fedora yum repos中当前可用的版本没有启用Webosockets,因为没有可用的libwebsocket包。我假设CentOS使用的是相同的SRPM


查看此bugzilla enrty了解详细信息:

您可以像这样修改config.mk

在config.mk中

# Build with websockets support on the broker.
WITH_WEBSOCKETS:=yes
那么您可以使用配置参数吗

listener 10001 127.0.0.1
protocol websockets
在目录mosquitto-1.4.X中 编辑config.mk文件:

# Build with websockets support on the broker.
WITH_WEBSOCKETS:=yes
然后在目录mosquito-1.4.X中运行

make
sudo make install
编辑配置/etc/mosquitcho/mosquitcho.conf

listener 10001 127.0.0.1
protcol websockets
并重新启动

mosquitto -c /etc/mosquitto/mosquitto.conf

你能解释一下这些步骤吗?我的Paho Javascript客户端和我在本地主机上安装的代理也有类似的问题,但我遵循了这些步骤,它对我有效,这是针对Windows的,但可能可以帮助你。我尝试了这些步骤,但不起作用,我缺少什么吗?当它与yum一起安装时该怎么办?
mosquitto -c /etc/mosquitto/mosquitto.conf