Websocket API (WAPI)

What is it?

  • Web push technology
  • HTML5 sepecification, supported since 2012 (94%)
  • Requires a long running process in the background on the server
  • CORS unrestricted
  • Maintains a live connection (tunnel) between browser and server
  • Port 80/443 recommended
  • Highly performant (low bandwidth, low latency, no polling)

What is it useful for?

  • Receiving updates to current page
  • Browsing sessions without page requests (SPA's)
    • state updates
    • refresh page command
  • Internal use websites (long running sessions)
    • notifications
  • Commerce
    • Up to date stock status, prices, and cart
    • Promotions and activities to current visitors
  • Large userbase sites
    • chat
    • online status
  • Mobile
    • In app notifications
  • Games and multi user apps
  • Dashboards and metrics
  • ....

Integration with Drupal

  • Permission system
  • Rules based broadcasts (?)
  • Daemon management (including drush)
  • Websocket plugins
  • Request batching (performant polling)
  • Browser notifications
  • ReactPHP/Ratchet

Current status

NTH Goals

  • Provide contrib
  • Start a websocket service
  • D7 Port
  • Node js daemon

Websocket API

By dofinity

Websocket API

  • 193