Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Decentralization & real-time with PubSubHubbub

Bd9b4485bcf325b989b5721bd0ef4d91?s=47 Bruno Renié
October 25, 2013

Decentralization & real-time with PubSubHubbub


Bruno Renié

October 25, 2013


  1. Decentralization & real-time with PubSubHubbub Bruno Renié soft-shake 2013

  2. exoscale

  3. FeedHQ.org github.com/feedhq

  4. 2009 RSS Readers

  5. Any update? Any update? Any update? Nope. Nope. Yup. Blog

    RSS Reader
  6. Polling sucks — everyone

  7. Publisher Hub Subscriber

  8. De�nitions Topic The unit to which one can subscribe to

    changes Hub Intermediary Subscriber Entity willing to be noti�ed of changes on a topic Subscription Subscriber - Topic relation Callback URL URL at which a subscriber wishes to receive noti�cations. Noti�cation Payload describing how a topic's contents have changed
  9. Publisher Declares his hub Pings the hub about new content

    <link href="http://example/hub" rel="hub"/> POST http://example/hub hub.url=<feed url> hub.mode=publish
  10. Subscriber Notices the publisher has a hub Subscribes to the

    hub POST http://example/hub hub.topic=<feed url> hub.mode=subscribe hub.callback=<callback url>
  11. Hub Receives pings Fetches publisher feeds Receives subscriptions Noti�es all

  12. Subscription Subscriber sees link with rel="hub" <link href="http://example/hub" rel="hub"/> Subscriber

    makes POST request to hub POST http://example/hub hub.topic=<feed url> hub.mode=subscribe hub.callback=http://subscriber/callback
  13. Subscription Hub makes GET request to subscriber callback GET http://subscriber/callback

    hub.topic=<feed url> hub.mode=subscribe hub.challenge=hello hub.lease_seconds=86400
  14. Publication Publisher pings the hub POST http://example/hub hub.url=<feed url> hub.mode=publish

  15. Publication Hub fetches the topic & posts the content to

    callback POST http://subscriber/callback Link: <http://example/hub>; rel="hub", <feed url>; rel="self" Content-Type: application/xml <payload>
  16. Demo http://www.flickr.com/photos/usnavy/6628020661/

  17. PubSubHubbub HTTP-based pub/sub protocol Open-Source GAE implementation Decentralized

  18. Decentralized? Anyone can host a hub In practice: Google hub

    & superfeedr http://pubsubhubbub.appspot.com/ http://superfeedr.com/
  19. Security Making sure noti�cations come from the real hub Hub/Subscriber

    shared secret Hub signs its requests with HMAC SHA1 digest X-Hub-Signature: sha1=d07d89c67…
  20. Real-life publishers wordpress / wordpress.com tumblr �attr blogger youtube GitHub

  21. feedhq.org ~25% of feeds have a hub

  22. Beyond RSS Initial spec (0.3) targeted Atom/RSS Current (0.4) allows

    arbitrary content <link href="http://example/hub" rel="hub"/> Link: <http://example/hub>; rel="hub"
  23. Publisher Hub Subscriber Subscriber Subscriber Subscriber Subscriber Subscriber

  24. Hub Publisher Subscriber Publisher Subscriber Publisher Subscriber

  25. None
  26. Thanks ! @brutasse bruno@renie.fr