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

Decentralization & real-time with PubSubHubbub

Bruno Renié
October 25, 2013
150

Decentralization & real-time with PubSubHubbub

Bruno Renié

October 25, 2013
Tweet

Transcript

  1. 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
  2. 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
  3. 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>
  4. 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
  5. 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
  6. 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>
  7. Decentralized? Anyone can host a hub In practice: Google hub

    & superfeedr http://pubsubhubbub.appspot.com/ http://superfeedr.com/
  8. 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…
  9. 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"