WebSub (formerly PubSubHubbub) is an
open protocol for distributed
publish–subscribe communication on the
Internet
The Internet (or internet) is the global system of interconnected computer networks that uses the Internet protocol suite (TCP/IP) to communicate between networks and devices. It is a ''internetworking, network of networks'' that consists ...
. Initially designed to extend the
Atom
Every atom is composed of a nucleus and one or more electrons bound to the nucleus. The nucleus is made of one or more protons and a number of neutrons. Only the most common variety of hydrogen has no neutrons.
Every solid, liquid, gas ...
(and
RSS
RSS ( RDF Site Summary or Really Simple Syndication) is a web feed that allows users and applications to access updates to websites in a standardized, computer-readable format. Subscribing to RSS feeds can allow a user to keep track of many di ...
) protocols for data feeds, the protocol can be applied to any data type (e.g.
HTML
The HyperText Markup Language or HTML is the standard markup language for documents designed to be displayed in a web browser. It can be assisted by technologies such as Cascading Style Sheets (CSS) and scripting languages such as JavaScri ...
, text, pictures, audio, video) as long as it is accessible via HTTP. Its main purpose is to provide real-time
notifications of changes, which improves upon the typical situation where a client periodically
polls the feed server at some arbitrary interval. In this way, WebSub provides pushed HTTP notifications without requiring clients to spend resources on polling for changes.
In October 2017, PubSubHubbub was renamed to WebSub for simplicity and clarity.
, the WebSub protocol has been adopted by the
W3C as a Recommendation.
Protocol
Under WebSub, there is an ecosystem of publishers, subscribers, and hubs.
A subscriber first retrieves content from an HTTP resource (
URL
A Uniform Resource Locator (URL), colloquially termed as a web address, is a reference to a web resource that specifies its location on a computer network and a mechanism for retrieving it. A URL is a specific type of Uniform Resource Identifie ...
) by requesting it from the webserver. The subscriber then inspects the contents of the response, and if it references a hub, the subscriber can subscribe to that resource's URL (it's called a 'topic' by the spec) on that hub. The subscriber needs to run a web accessible server so that hubs can directly notify it when any of its subscribed topics have updated, using a
webhook mechanism.
Publishers expose their content with the inclusion of hub references in the HTTP headers. They post notifications to those referenced hubs whenever they publish something. Thus, when a publication event occurs, the publisher calls its hubs and the hubs call their subscribers.
WebSub includes a simple verification of intent mechanism in order to prevent abusive subscriptions, and a validation mechanism allows for subscriptions to private or protected web resources. When the subscriber sends the subscription request to the hub, the subscriber address and a code needs to be included. The hub immediately sends a verification message to the subscriber with the URL of the topic and the above code. The subscription request will only be accepted if the subscriber sends a positive response to the verification request of the hub.
In order to provide a secure chain, subscribers should
share a secret with the hub, which will be used by the hub to compute an
HMAC key that will be sent to the subscriber. The latter can then easily verify the origin by comparing the supplied
signature
A signature (; from la, signare, "to sign") is a Handwriting, handwritten (and often Stylization, stylized) depiction of someone's name, nickname, or even a simple "X" or other mark that a person writes on documents as a proof of identity and ...
with a similarly computed signature on their end.
Usage
WebSub is used to push content by many websites, including all
blog
A blog (a truncation of "weblog") is a discussion or informational website published on the World Wide Web consisting of discrete, often informal diary-style text entries (posts). Posts are typically displayed in reverse chronological order ...
s served by
Blogger and
WordPress.com, news sites including
CNN and
Fox News
The Fox News Channel, abbreviated FNC, commonly known as Fox News, and stylized in all caps, is an American multinational conservative cable news television channel based in New York City. It is owned by Fox News Media, which itself is ...
, and social networks like
diaspora*,
Mastodon,
MySpace or
Medium.com
Medium is an American online publishing platform developed by Evan Williams and launched in August 2012. It is owned by A Medium Corporation. The platform is an example of social journalism, having a hybrid collection of amateur and professio ...
.
Subscribing services (“feed readers”) include
Flipboard,
Feedly,
NewsBlur, among other popular options.
Community Hosted hub providers include pubsubhubbub.appspot.com (operated by
Google
Google LLC () is an American Multinational corporation, multinational technology company focusing on Search Engine, search engine technology, online advertising, cloud computing, software, computer software, quantum computing, e-commerce, ar ...
), pubsubhubbub.superfeedr.com (operated by
Superfeedr), and websubhub.com.
Superfeedr provides a detailed PubSubHubbub guide for implementation.
See also
*
Publish–subscribe pattern
*
RSS Cloud
RSS Cloud is an optional sub-element of the RSS protocol's <channel> element that enables realtime (immediate) push notifications or distributed publish/subscribe communication for feeds. This is done using a element allowing a software se ...
*
RSS to email
RSS ( RDF Site Summary or Really Simple Syndication) is a web feed that allows users and applications to access updates to websites in a standardized, computer-readable format. Subscribing to RSS feeds can allow a user to keep track of many di ...
References
{{W3C standards
RSS (file format)
RSS ( RDF Site Summary or Really Simple Syndication) is a web feed that allows users and applications to access updates to websites in a standardized, computer-readable format. Subscribing to RSS feeds can allow a user to keep track of many di ...
Web syndication formats
XML-based standards
Computer file formats
Google
World Wide Web Consortium standards