I\'m learning pubnub and I read their documentation but I just can\'t find how to manage a multi room chat box.
By default, a channel can be listened by anyone. Subscri
The answers above were correct in 2012, but a lot has changed since then. Private chat rooms can be enabled with PubNub Access Manager, which explicitly grants Publish/Subscribe access on specific channels.
The way this works is through access tokens (aka an "Auth Key"). The developer (you) creates an Auth Key (basically any string of characters) and passes it to PubNub Access Manager. You then set the rules for this Auth Key (i.e. which channels the Auth Key can publish and/or subscribe to).
This Auth Key is provided to any device that needs access to the channel, and used when the device subscribes or publishes to the channel.
Basic docs are available here: http://www.pubnub.com/docs/javascript/tutorial/access-manager.html
Grant 60 minute read/write privilege to channel "privateChat" to an auth_key:
pubnub.grant({
channel : 'privateChat',
auth_key : 'abxyz12-auth-key-987tuv',
read : true,
write : true,
ttl : 60
});