Serving a Full Drupal Site Via Websockets

smccabe

Using PHP based websockets in Drupal. There have been some overviews of basic websocket setup, but most don’t go into much depth on integrating this with Drupal. We will setup a websocket server that runs a persistent full Drupal install and can communicate via the standard JSON API spec.

 

We will go over

  • Basics of sockets and how they work
  • Basics of websockets and the websocket spec
  • How to setup a ratchet php websocket server
  • How to hook the websocket server into Drupal
  • How to expose existing end-points over websockets, such as JSON-API
  • How to create new endpoints
  • How to connect your Drupal frontend to these websockets
  • How to connected an unrelated React frontend to the websockets
  • How to connect with a different backend platform, such as NodeJS and Go
  • Time permitting, show a few examples of this in practice.

And yes, we can do all this in 90 minutes.

This talk/lab will be an expansion of some of the initial work I’ve done here: https://blog.acromedia.com/drupal-with-websockets-for-real-time-synced-displays

Lando and Docker Compose (and maybe ddev) setups will be provided before this presentation if you wish to follow along.

Attendees should be reasonably familiar with Drupal 8 and Javascript, websocket or networking experience not required.

Program tags

ambitious digital experiences, decoupled, performance

Experience Level

Intermediate

Drupal Version