How to launch mosquitto mqtt broker in shutter mode on the Internet

Has anyone successfully completed mosquitto to roll forward the online version in a free account ?

There are two relevant SO issues, but not really resolving all the issues:

Things that have been done so far:

  • I started the websocket python server to make sure that openshift does support websocket, although the cartridge is DIY.
  • I also compiled mosquitto and run it locally off github sample .

What are the exact steps to start mosquitto to start with an opening shift?

0
source share
1 answer

Finally, I started working on openshift, albeit with the simplest configuration. Here are the basic steps:

  • Use the openshift cartridge DIYto get websocket support, which provides an external port 8000and is redirected to the internal port 8080to the virtual IP address specified OPENSHIFT_DIY_IP.
  • mosquitto , config.mk, openshift: WITH_TLS, WITH_TLS_PSK, WITH_THREADING, WITH_BRIDGE, WITH_SRV, WITH_UUID, WITH_DOCS, WITH_SOCKS.
  • Makefile mosquitto, DOCSDIR. ​​, WITH_DOCS , DOCSDIR.
  • WITH_WEBSOCKETS config.mk.
  • src/webockets.c. mosq_websockets_init() 625 info.iface = listener->host; , info.user = user;. , IP- . mosquitto 0.0.0.0 IP-. , libwebosockets.
  • libwebsockets libwebsockets-devel.
  • make, .
  • , mosquitto ../mosrun. . make prefix= DESTDIR=$(pwd)/../mosrun install.
  • ../mosrun sbin. cd ../mosrun/sbin cp /usr/lib/libwebsockets.so.7 .. libwebsockets lib.
  • https://github.com/jpmens/simple-mqtt-websocket-example. mosrun/sbin/simpleweb.
  • mosrun/sbin/simpleweb/config.js, , DIY, 8000. javascript DIY- .
  • mosquitto mosrun/sbin/mosquitto.conf, : listener 8080 <OPENSHIFT_DIY_IP>, protocol websockets, http_dir simpleweb connection_messages. IP- DIY <OPENSHIFT_DIY_OP>.
  • -.
  • DIY , .
  • openshift .openshift/action_hooks/start .../stop, . . , .
  • mosquitto mosrun/sbin.
  • LD_LIBRARY_PATH=. ./mosquitto -c mosquitto.conf -v, mosquitto.
  • diy-yourdomain.rhcloud.com:8000/index.html. mqtt websockets, jpmen github repo.

DIY git. -, . script, , config.js mosquitto.conf .

, : jpman .

+1

All Articles