Realtime provides a self-hosted alternative to Pusher. It offers realtime updates of activity on your forum, not just for members but also for guests.
- Auto update of index (while keeping permissions & subscription states in mind).
- Auto update of notifications (likes, replies, but also for flags).
- New posts pushed into discussions.
- Typing indicator.
Managed Flarum communities that we host on our platform (blomstra) will have access to all premium extensions we publish without additional cost.
Alternative you can see our plans on extiverse. After completing your order, check your active subscriptions and follow the provided instructions. Then install using:
composer require blomstra/realtime:*
Enable the extension inside the admin area and continue below with the Set up.
Method a) use the defaults
No action needed. Your websocket will re-use the configuration of your existing forum.
Method b) the
Create a key
websocket and override any of the configuration items as defined in
Run the websocket server
For the websocket to run you will need to run its server. To do so for testing purposes, use:
php flarum realtime:serve -vvv --debug
This will boot the server and throw any debug information it can.
In production, you will need to set the websocket server to run continuously and restart when it errors. You can use a tool like supervisord for that.
# On Debian / Ubuntu
apt install supervisor
# On Red Hat / CentOS
yum install supervisor
systemctl enable supervisord
Now create a new file inside the
/etc/supervisor/conf.d directory called
/var/www/flarum being the path to your Flarum installation.
www-data being the web user that runs your Flarum forum in apache, nginx or other web server software.
command=/usr/bin/php /var/www/flarum/flarum realtime:serve
Now read the configuration file and start the service:
supervisorctl update && supervisorctl start realtime
If you want to run the websocket server encrypted, the easiest way is to proxy the port with your webserver software (apache, nginx). Find instructions for these online or create a ticket at https://helpdesk.blomstra.net for assistance.
Why yet another websocket extension?
With realtime we wanted to lay a stable foundation for additional features. This foundation is made by keeping third party dependencies to a minimum, creating our own convention for event naming and payload generation, but also by re-using as much of the Flarum core code as possible. We needed a reliable and scalable websocket extension for our customers and realtime delivers.
How many concurrent users does realtime support?
Resource usage of the websocket is really low. You should be able to serve thousands simultaneous users with
only 1 cpu and 1 GB of memory dedicated to the process. Once we are able to provide a better indication from usage at scale, we will update this FAQ item. As a general rule of thumb it's always better to oversize your realtime daemon resource limitations and then - based on experience - reduce them to meet actual resource cost.
I have another question.
Reach out to us via https://helpdesk.blomstra.net. We will get back to you as soon as we can. If you have a running subscription please mention when you started your plan and/or which plan you are on. Always add sufficient information when reporting errors. We prefer errors being reported here, but understand that sometimes you can't.