Posts Tagged ‘vernemq’
Paho MQTT Client (Javascript), Envoy, VerneMQ: debugging disconnects
After deploying picockpit to my server, a bug was observed: the web frontend would disconnect in very regular intervals. This had not been present on the local development environment. Users of picockpit reported the same bug. I have debugged it today, and applied a hotfix. It turns out it was a timing issue. TL;DR how…
WeiterlesenVerneMQ how to disconnect clients forceably per command line
There is a command vmq-admin session show which will show you the currently connected clients: Unfortunately, this output is truncated for a total width of 80 characters (no matter how many would fit) and there is currently no indication that it is. See this VerneMQ Github issue: https://github.com/vernemq/vernemq/issues/1200 To disconnect clients you need the client_id…
WeiterlesenVerneMQ MQTT connection lost (8): AMQJS0008I Socket closed. different mountpoints
In my setup, I am rewriting the mountpoints of clients from the ones set up by the listeners to individual mountpoints depending on client group. The idea behind this is perfect isolation of multi-tenancy on the server. Individual clients from different groups thus are not able to see each other, even when subscribing to “#”…
WeiterlesenChanging the mountpoint on auth_on_register webhook for VerneMQ
It is possible to pass modifiers along with the “result”: “ok” return value of your webhook for VerneMQ. The official documentation of VerneMQ gives some examples for the syntax. changing the mountpoint It is also possible to change the mountpoint, however the client_id apparently has to be passed in as well! I have raised an…
WeiterlesenMaximimum length of credentials (username, password, clientid) in MQTT v3.1.1
The CONNECT packet The MQTT CONNECT Control packet always contains a payload. It is the first packet, which the client must send to the server after the connection is established. It can only be sent once by the client, if a second CONNECT packet is sent, the server (broker) must process it as a protocol…
WeiterlesenDebugging VerneMQ connection / authentication problems for dual authentication with webhooks and vmq_diversity
TL;DR https://github.com/vernemq/vernemq/blob/master/apps/vmq_diversity/src/vmq_diversity_plugin.erl includes a statement which will block authentication / authorization through any other channels if your Lua script returns “false”: will lead to: instead of trying other plugins, as you might have assumed! In order to avoid this problem, simply do not return anything from your Lua script, if you do not want to…
WeiterlesenVerneMQ: econnrefused & Webhook example
Webhooks activate webhooks like this in your vernemq.conf.local (.local when running on docker, so that settings at bottom of the file will persist): plugins.vmq_webhooks = on vmq_webhooks.js_auth_on_register.hook = auth_on_register vmq_webhooks.js_auth_on_register.endpoint = http://container_picockpit:1200/example/path Note that if your webhook is not accessible (econnrefused), the db based authentication will also fail … ! If you get errors like…
WeiterlesenVerneMQ Docker overwrites my configuration
Situation You edit vernemq.conf, only to find that your configuration is overwritten by VerneMQ on the next start (using the official Docker container). Specifically, the section with the listeners at the end of the file is “forced upon you”. Solution VerneMQ is started using a script (start_vernemq). The script can be seen here: https://github.com/vernemq/docker-vernemq/blob/master/bin/vernemq.sh The…
Weiterlesenenvoy not connecting to VerneMQ for MQTT over websockets, error code 503
Some quick background information for anyone running into the same issues, and how to debug them. Error code 503 This is the error code I am getting: Error during WebSocket handshake: Unexpected response code: 503. Set envoy logging to debug Here’s my docker-compose.yaml for envoy: version: ‘3.7’ services: envoy: build: context: ./ dockerfile: Dockerfile container_name:…
Weiterlesencorrect way to instantiate Paho Client in JavaScript for wss (secure websocket)
The Paho documentation is unfortunately quite fragmented at the moment, and some links on Eclipse’s website do not work. Here are some working links (as of 05/2019): https://www.eclipse.org/paho/clients/js/ https://www.eclipse.org/paho/files/jsdoc/index.html https://github.com/eclipse/paho.mqtt.javascript And here’s a fantastic website by Steve: http://www.steves-internet-guide.com/using-javascript-mqtt-client-websockets/ There is an important breaking change in the Paho namespace, where you will run into trouble using…
Weiterlesen