Ask Your Question

MQTT over Websocket?

asked 2018-01-29 14:59:32 +0000

anonymous user


updated 2018-02-01 12:57:27 +0000

grahamb gravatar image


I'm trying to use wireshark to decode MQTT over Websocket traffic...considering Wireshark already decodes both websocket and MQTT traffic over TCP, this doesn't sound too hard, but I haven't been able to do it.

I've tried many iterations and permutations, but in it's simplest form, I want to get a handle to the existing MQTT dissector from TCP port 1883 (standard port for MQTT over TCP) and install it after the Websocket dissector running on port 8083 (standard port for MQTT over Websocket)...although this LUA does not compile, the idea is something like this...

local tcp_dissector_table = DissectorTable.get("tcp.port")
local ws_dissector_table = DissectorTable.get("ws.port")
local mqtt_dissector = tcp_dissector_table:get_dissector(1883)
ws_dissector_table:add(8083, mqtt_dissector)

Am I even approaching this problem the right way?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-02-01 15:51:04 +0000

grahamb gravatar image

WebSocket has support for a number of protocols running on top of it, and has dissector tables to allow registration of these protocols, (in decreasing order of preference):

  • Negotiated protocols, use table "ws.protocol", providing the negotiated protocol name.
  • TCP Port dissectors, use table "ws.port", providing the port.
  • Heuristic dissectors, use table "ws".

So, if MQTT over WebSocket isn't negotiated, but port-based, then I think you should use something like:

local mqtt_dissector = Dissector.get("mqtt")
local ws_dissector_table = DissectorTable.get("ws.port")
ws_dissector_table:add(8083, mqtt_dissector)
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2018-01-29 14:59:32 +0000

Seen: 1,470 times

Last updated: Feb 01 '18