I created a nifty throw-away demo called WebSlides that switches between slides (PNG images). The slide show presenter navigates to a URL on their smart phone and is able to tap on back or forward links to change the current slide. The audience and the computer running the projector run a browser that points to another URL. As the presenter changes the slide all the clients connected see the updated slide.
What is a server-sent event?
How did I do it?
I created the WebSlides demo using ASP.net MVC, I believe I am the first to create something like this as support for server-sent events is pretty fresh. I found that this guy created a chat client with cold fusion on the server-side which is pretty cool.
In my demo I created a new ActionResult called ServerSentEventResult that does all the heavy lifting you need to do make the browser happy.
So all you have to do is use it like this in your controller.
1 2 3 4 5 6 7 8
Another interesting point to note about my implementation is the lambda used to get the content, you may remember that the browser will poll the server to get events, so why make the server serialize data if it is not necessarily going to send it every request.
The rest of the magic happens on the client side with jQuery, If you have come this far I will leave it to you to dig around on github to see how that works.