Skip to content


Folders and files

Last commit message
Last commit date

Latest commit



80 Commits

Repository files navigation

WebSub test suite and debugging utility.

You can test your Publisher, Subscriber and Hubs using

Configuring to run locally can be a bit of a challenge, so here are some resources you may find useful to test your local services against the public

Installation Instructions



You can either install from git, or download a zip file from the list of releases.

Installation from Git

Requires installing dependencies via Composer

git clone
composer install

Installation from zip release

Contains all dependencies already packaged.

  • Download latest release
  • Extract to a folder on your computer


Copy the lib/config.template.php file to lib/config.php and fill it out. You'll need to set the following:

  • $base - the full base URL where you've installed, e.g.
  • $redis - configure the host and port to your Redis instance, e.g. tcp://
  • $dbhost and others - configure the name, host, username and password for your MySQL database
  • $skipauth - set to true to bypass emailing login links
  • $secret - set to a random string, used for signing tokens
  • $mailtun - if you want to email login URLs, configure your Mailgun account info here

Install Redis

Install Redis however is appropriate for your platform. The default configuration is fine.

Install MySQL

Install MySQL, and create a new database called websubrocks.

Create the Database

The database schema is in the database/ folder, so you can set up the database with the following command:

mysql -u root websubrocks < database/schema.sql

Install Nginx requires nginx compiled with the nginx push stream module to enable realtime features of the tool.

You will need to build nginx from source in order to include the module. Feel free to follow any nginx tutorial to install it on your platform. The instructions should look more or less like the below.

  • download nginx source from
  • git clone
  • ./configure --prefix=/usr/local/nginx --add-module=../nginx-push-stream-module --with-http_v2_module
  • make -j 4
  • sudo make install

Nginx Configuration

You'll need to modify your nginx configuration to include the following.

http {
  # your existing defaults are probably fine

  # Set the php pool to where you have configured php-fpm to run.
  # Note this may also be a socket instead of a port.
  upstream php-pool {

  push_stream_shared_memory_size 32M;

server {
  listen       80;

  root /path/to/;

  # index.php handles all requests that aren't static files
  location / {
    try_files $uri /index.php?$args;

  location ~ \.php$ {
    fastcgi_pass    php-pool;
    fastcgi_index   index.php;
    include fastcgi_params;
    fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;

  # These are the push-stream streaming endpoints for publishing and subscribing

  location /streaming/pub {
    push_stream_publisher admin;
    push_stream_channels_path    $arg_id;

  location /streaming/sub {
    add_header 'Access-Control-Allow-Origin' '*';
    push_stream_subscriber eventsource;
    push_stream_channels_path    $arg_id;
    push_stream_message_template                "{\"id\":~id~,\"channel\":\"~channel~\",\"text\":~text~}";
    push_stream_ping_message_interval           10s;