我正在尝试利用Mosquittos的最新更新来支持代理中的websockets。我正在运行Mosquitto v1.4.2,并且我已经将以下代码行添加到蚊子配置文件(mosquitto.conf)中:
listener 10001 127.0.0.1
protocol websockets
listener 1883
protocol mqtt当我尝试使用新配置启动代理时,我得到以下信息:
$ 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 (不需要像1.4版之前那样从源构建来启用websocket支持),所以我想知道我错过了什么。任何有关解决问题的方向的帮助都将不胜感激。
编辑:忘记提到我正在运行CentOS6
发布于 2015-05-22 14:57:12
虽然1.4.x代码库包含Websocket支持,但它必须在构建时启用,并依赖于libwebsocket库。
RedHat/Fedora yum repos中当前可用的构建没有启用Webosockets,因为没有可用的libwebsocket包。我假设CentOS使用的是相同的srpm。
详细信息请参阅bugzilla enrty:https://bugzilla.redhat.com/show_bug.cgi?id=1197678
发布于 2015-06-28 11:33:26
您可以像这样修改config.mk
在config.mk中
# Build with websockets support on the broker.
WITH_WEBSOCKETS:=yes那么您可以使用config参数吗
listener 10001 127.0.0.1
protocol websockets发布于 2016-12-07 05:59:30
在dir mosquitto 1.4.X中,编辑文件config.mk:
# Build with websockets support on the broker.
WITH_WEBSOCKETS:=yes然后在dir mosquitto 1.4.X中运行
make
sudo make install编辑配置/etc/mosquitto/mosquitto.conf
listener 10001 127.0.0.1
protcol websockets并重新启动
mosquitto -c /etc/mosquitto/mosquitto.confhttps://stackoverflow.com/questions/30383753
复制相似问题