Code Monkey home page Code Monkey logo

Comments (5)

robertsLando avatar robertsLando commented on July 2, 2024

I think the question is more related to mqtt-packet parser then aedes itself, would you mind to open a PR there?

from aedes.

gmnprada avatar gmnprada commented on July 2, 2024

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

if the object contains data property, it will be parsed as an [mqtt-packet](https://github.com/mqttjs/mqtt-packet).

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.

from aedes.

robertsLando avatar robertsLando commented on July 2, 2024

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

from aedes.

gmnprada avatar gmnprada commented on July 2, 2024

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.

from aedes.

getlarge avatar getlarge commented on July 2, 2024

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.
If you check this part of Aedes when connection packet is handled, you can observe how the packet .protocolVersion is assigned to client.version. In preConnect hook this assignment is not yet made, but you can still check the packet.protocolVersion at that stage and add your custom logic.

For the aedes-protocol-decoder integration, you can have a look at aedes-server-factory to see how to use it or even simpler directly use that library!

Hopefully that will help.

from aedes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.