-
-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[question] Parsing a packet that come from old mqtt client version #902
Comments
I think the question is more related to mqtt-packet parser then aedes itself, would you mind to open a PR there? |
no the question is more related to aedes after I do much digging on this huge separated module I end up seeing how aedes parse packet in aedes-protocol-decoder in top of tcp that use the mqtt-packet parser. there is nothing to with mqtt-packet its can parse it. if I do pass a trust proxy and seeing the raw buffer on top of tcp I do had that complete header packet , but aedes side like missing message-id that crash the whole program at node runtime , what I want to ask here is how the current flow aedes do broking the packet from its huge repo. the aedes protocol decoder its says
having a handle and opts in that decoder for each mqtt protocol version on handling the flow of data in aedes is what I need here to not crash the entire flow of callback / middleware that's next need to do the chain of calls handling the stream. its will be convenience also if the broker handle for that different version of mqtt. something like this TCP Stream -> MQTT -> parseAsV3, parseAsV4, parseAsV5 -> Packet (To High level handler) or subscription function handler. |
Try to submit a PR on aedes that implements what you want because it's not 100% clear to me what you want to do here |
I fork and create a commit on some test at aedes-protocol-decoder , cannot submit a PR now (need to read some mqtt specification clearly) before doing that implementation to solve current running problems. the commit link https://github.com/madepriambhada/aedes-protocol-decoder/commit/f33a7e80f1e0ce9b278dff7b12a26da8ef10eb13 will do that soon after I correctly can identify the old client program some user use to connect into broker. |
Hi @madepriambhada, I am not certain that I got what you are asking for ( don't want to be rude, but maybe you can use a good translation app ? ) but I will give it a try. For the Hopefully that will help. |
Dunno this may be result on bug that can be produced or not.
today I refactor my old server code that previously use mqtt.js connected into mosquitto broker
the old client protocol should be set to protocolVersion : 3 ,(the default is 4) on mqtt.js to be able parse the packet correctly.
previously it use to broke a connection from tcp socket into frontend ws socket its working fine.
when I finished the aedes broker to run it the connection established fine and the broker can subscribe to some topic.
until I notice a log in some line inform unknown packet,
when I debug that the packet.payload is truncated (Some header message is gone)
the usual server code if mosquitto as a broker , the server code just a regular mqtt.js client.
my question is how I can handle properly the client that still using protocol version 3 in aedes?
I try to use mqtt-packet which aedes-packet use under the hood to identify the client
something like this hooks in pre-connect.
or is there a opts function that I can pass to aedes like on mqtt-packet?
The text was updated successfully, but these errors were encountered: