Oleksandr Yarushevskyi
Oleksandr Yarushevskyi

Reputation: 3289

How can I get list of subscribed clients in autobahn.ws?

Now I'm developing chat using wamp-protocol, crossbar.io, autobahn.ws. We have rooms only for two clients. I need to define if other client is in room, if it in I publish new message in other case I make request to GCM. Every room has own uri like 'com.example.chat.'

That's why I need to get list of clients in specified uri 'com.example.chat.'.

Upvotes: 1

Views: 708

Answers (1)

gzost
gzost

Reputation: 2445

This is possible via the meta-API - see http://crossbar.io/docs/Subscription-Meta-Events-and-Procedures/

So you'd retrieve the list of subscribers for the room topic by doing

session.call("wamp.subscription.list_subscribers", [23560753]).then(session.log, session.log)

where you'd use the subscription ID assigned to the topic by Crossbar.io.

Upvotes: 2

Related Questions