Reputation: 6986
I am working with a Backbone front end, and we are currently making it realtime with the use of pusher. Most of the events are triggered from our API and then we listen to them on channels in our backbone front end.
However there is situation where we want to update a view for all subscribers to a channel on a button click, there is no server interaction here and we would like to keep is this way.
I have read the documentation for pusher, and it sounds like what we want is a client event, but from what I have read it sounds like this needs to be authenticated request...however by the virtue that the user is using the application means they have been authenticated.
Is there a way to broadcast an event from a client and not need a private channel or to authenticate?
Upvotes: 0
Views: 414
Reputation: 66
There is not. If there were then anyone would be able to connect to Pusher independently of your application and publish arbitrary client events to your users.
Without the authentication provided by a private channel, it's not necessary to be using your application to join your channels. All that is required is your App ID, which is the equivalent to a username - that is to say, it should be considered public knowledge.
The same goes for broadcasting to public channels from your server. They really are public, if you want to restrict the audience to authenticated users of your app, you should use private channels.
Upvotes: 1