[linux]Let mosquitto support websockets

2016-5-11 写技术

1.Install libwebsockets 
$ wget http://git.libwebsockets.org/cgi ... 3-firefox-36.tar.gz 
$ tar zxvf libwebsockets-1.4-chrome43-firefox-36.tar.gz 
$ cd libwebsockets-1.4-chrome43-firefox-36 
$ mkdir build 
$ cd build 
$ cmake .. 
$ make install 
$ ldconfig

2.Config mosquitto to support websocket 
a.Edit configure.mk:
WITH_WEBSOCKETS:=yes

b.Edit /etc/mosquitto/mosquitto.conf:
port 1883 
listener 9001 
protocol websockets

3.You may get this error:
"mosquitto: error while loading shared libraries: libwebsockets.so.5: cannot open shared object file: No such file or directory"
Probably your libwebsocket file is located in the /usr/local/lib folder
Solution:
sudo ln -s /usr/local/lib/libwebsockets.so.5 /usr/lib/libwebsockets.so.5


标签: linux

评论:

肖肖
2016-09-20 14:29
https://git.libwebsockets.org/cgi-bin/cgit/libwebsockets/snapshot/libwebsockets-1.4-chrome43-firefox-36.tar.gz
这个地址

发表评论:

Powered by anycle 湘ICP备15001973号-1