crossbario / autobahn-js

WAMP in JavaScript for Browsers and NodeJS
http://crossbar.io/autobahn
MIT License
1.43k stars 228 forks source link

Subscribing to all messages #237

Open johngeorgewright opened 8 years ago

johngeorgewright commented 8 years ago

Is there a way to listen to all messages? The reason I ask is because I'd like to make a monitoring tool for a WAMP setup. I've tried:

session.subscribe('', () => {}, {match: 'prefix'})

and...

session.subscribe('.', () => {}, {match: 'wildcard'})

Neither work.

oberstet commented 7 years ago

The first one should work. The router has to allow that though, and the client needs to be authorized to receive the respective events.

oberstet commented 7 years ago

Actually, if this is with Crossbar.io, then this might be a bug there: when you do a subscribe as above, this will include meta events under "wamp." (and "crossbar."), like "on_create_subscription", but since the subscription is only being setup right now, these meta events arrive at the client before the subscription request can even return successfully. AutobahnJS|Python will kill the connection ("protocol error") upon receiving an event with a subscription ID that it doesn't know about. I have a fix for that on a dev branch.