Comments (10)
What you want is https://github.com/mqtt/mqtt.github.io/wiki/bridge_protocol.
Unfortunately, this is not currently supported in Mosca.
from aedes.
I'm not so sure this would be a good fix.
I'm referring to the possibility of ignoring certain subscribed clients which meet a specific criteria, when publishing a certain message from the broker ( all clients are connected to the same broker )
So basically, adding some sort of filter ( probably based on id, regex maybe ? ) when publishing a message from the broker to subscribed clients
p.s.: I know this a bit far fetched. I`m just hypothetically asking if this could be done in Aedes
from aedes.
In mosca there is authorizeForward. I will probably add the same thing here.
from aedes.
Ok. So, instead of directly forwarding, it should call the authorizeForward, which in turn may call the forward callback, right ?
from aedes.
That's in Mosca, yes.
from aedes.
Yes, in mosca terms. In aedes terms, I`m thinking a callback should be added to the publishActions array ( https://github.com/mcollina/aedes/blob/master/lib/handlers/publish.js#L15 )
I'll have a look when I have some time, and submit a pr if I get anywhere. Is that ok ? :)
from aedes.
I looked around, and from what I can gather, Aedes.prototype.subscribe
should recieve the client, in order to be able to do any fine grained filtering based on it and send it further down towards the notify function added in MQEmitter.prototype.on
function.
Then, more or less wrap every call to the matched topic methods to a authorizeForward
function
However, I'd like to hear your input before I change anything, since this looks pretty since this way looks pretty hacky.
le:
Also, I`m thinking this could really affect perfomance, and given the low overhead of an mqtt packet, the clients could just handle their own filtering, instead of passing the responsibility on the broker.
from aedes.
I agree with your evaluation on performance, and that's why I did not do it in the first place here.
However, if you can come up with a way that implements this without affecting performance and it's valid, I'll be more than happy to merge it.
I suggest you to put it in https://github.com/mcollina/aedes/blob/master/lib/client.js#L71-L86, and https://github.com/mcollina/aedes/blob/master/aedes.js#L204 (for QoS 1/2 and offline).
Doing it in MQEmitter will be wrong, as authorization is not one of its responsibilities.
from aedes.
Ok, I'll look into it and add some tests once I get it working
from aedes.
Released in 0.16.0.
from aedes.
Related Issues (20)
- [feat!]: change to named exports to enable monkey patching HOT 11
- [question] Parsing a packet that come from old mqtt client version HOT 5
- Can Aedes send webhooks? HOT 2
- [bug] - TypeError during aedes Module Initialization
- mqtt服务启动后无法打印内容 HOT 2
- [bug] Aedes is undefined in Typescript HOT 7
- [bug] duplicated closed clients HOT 1
- [bug]"done" is not a function
- [question] does the test "unsubscribe throws error" valid? HOT 3
- [question] Any way to add data to connect packet and authorize handler? HOT 2
- [question]Frequent service clientError Error: invalid status code: 12592 HOT 1
- [bug] Number of TCP Connections accepted on container is less than the one deployed in EC2 machine HOT 7
- [bug] console.error introduced in v0.51.0 HOT 1
- [bug] Not all messages are consumed when dedupe is enabled HOT 7
- [question] Can i modify the source code of aedes and use in my project? Please help me out if there are any restrictions ? HOT 1
- [question] Zero length packet when connect and subscribe HOT 5
- how many clients can connect to the mqtt broker, limit 256 ? HOT 1
- Problem feedback HOT 6
- [bug] Aedes is running out of memory when starting with 30 million subscriptions in MongoDB.
- [bug] Aedes is creating a subscription with the clientId set to 'test' and a global topic of '#'.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aedes.