WebSub Hub

A hub following the W3C WebSub recommendation. Hub URL: https://websub.86-119-48-201.asse.scs.unisg.ch/. Active subscriptions: 4.

Debugging

Secrets never appear in either. Neither do passwords in URLs or query parameters named like credentials (token, key, secret, ...).

Subscribe

curl -i https://websub.86-119-48-201.asse.scs.unisg.ch/ \
  -d hub.mode=subscribe \
  -d hub.topic=https://publisher.example/topic \
  -d hub.callback=https://subscriber.example/callback \
  -d hub.lease_seconds=3600 \
  -d hub.secret=a-random-secret

The hub answers 202, then sends GET <callback>?hub.mode=subscribe&hub.topic=..&hub.challenge=..&hub.lease_seconds=... Answer it with 200 and exactly the hub.challenge value as body. hub.lease_seconds and hub.secret are optional. Unsubscribe the same way with hub.mode=unsubscribe.

Publish

curl -i https://websub.86-119-48-201.asse.scs.unisg.ch/ -d hub.mode=publish -d hub.topic=https://publisher.example/topic

The hub fetches the topic and POSTs its content to every subscriber, with the topic's Content-Type, a Link header naming the hub and the topic, and X-Hub-Signature if the subscriber gave a secret. To send the content yourself instead, put it in the body and the parameters in the query string:

curl -i 'https://websub.86-119-48-201.asse.scs.unisg.ch/?hub.mode=publish&hub.topic=https://publisher.example/topic' \
  -H 'Content-Type: application/json' -d '{"price": 42}'