Skip to content

Compare: Using Private Channels

New page
Showing with 24 additions and 0 deletions.
  1. +6 −0 Using-Private-Channels.md
  2. +18 −0 Working-with-Channels.md
6 changes: 6 additions & 0 deletions Using-Private-Channels.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,9 @@ var private_channel = dispatcher.subscribe_private('channel_name', function() {
console.log( "Authorization failed because " + reason.message );
});
```

By default, all subscribers in to a channel will be removed when that channel is made private. If you don't wish active subscribers to be removed from a previously public channel when making it private, uncomment and set the following in config/initializers/websocket_rails.rb to true.

```ruby
config.keep_subscribers_when_private = true
```