We have been keeping fairly quiet over the last few weeks, beavering away at all the little details. However, amongst our invisible stability and scalability work, we have found a bit of time to add in a new feature that many of you have asked for. Pusher now supports Presence!
We are now looking for some intrepid souls to integrate presence into their applications and give us some feedback. This means that the public API may change in future versions, so adding this to production applications should be done at your own risk!
What is it?
Why do I want it?
Because it allows you to give users a sense of who they are collaborating with. Maybe they’re working on a document together, but it could just be everyone who’s viewing a page.
Chat now becomes almost trivial to implement, but we think this is just the start.
How do I get started?
Look at the docs! If you are familiar with private channels, this should not be a huge change for you.
We broadcast member information in the same awesome event emitter format that you are already used to, so it should be a snap to get started. An example of the type of event you can bind to is:
alert( member.user_info.username + " has just logged in!");
A very basic example of how presence can be linked to logged in users is available here.
It has been quite an interesting feature to make, and we are confident that our callback-based system is the best way of guaranteeing authenticity. We work under the assumption that anything that comes directly from the client’s browser cannot be trusted. If I say I am ‘Max’, that has to be backed up with some credentials from a trusted application.
While looking at other implementations, we felt that though the way we do it is a little bit more involved, it is the only viable way of achieving this functionality where the authenticity of connected clients is essential.
We have added presence support to the latest version of our Ruby Gem (v0.6), and would encourage other library makers to make the necessary changes. There are some notes about implementing the signature here (it is basically an extension to private channels). Let us know if you need help.
“What happened to 1.4 and 1.5?” I hear you cry. These were released silently without much fanfare, but it is worth saying what they include at this point.
Allows clients who have failed to connect because of proxy issues to reconnect using an SSL connection. This fixes the majority of cases where a client had failed to connect in the past. It doesn’t work with the Flash fallback yet, but we are working on that.
Remember to let us know if you have any feedback, or need any help. And if you haven’t done so already, feel free to create a free Pusher account and let us know what you think!