â €
â €

⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
Locally hosted Pusher alternative that functions identically

â €

Performance
This package is battle-tested in real-world applications and can serve high traffic websites easily.

Permission Respecting
Unlike Pusher, WebSockets will continue to function with Byobu and private tags. Give your valued users and staff the treatment they have come to expect.

Inexpensive
With Pusher's plans starting at $49/month and going up fast from there, this package will save you money immediately.

No Extra Software
WebSockets comes with everything you need to get up and running, no need for any extra software. Forget about Node, use the power of PHP.

GDPR Compliance
Pusher can be a headache with GDPR as data is sent off your server. Fear no more! With WebSockets, no user data ever leaves your server.

Extension Compatibility
Currently, websocket supports:

  • fof/reactions
  • fof/gamification
  • fof/polls
  • The normal pusher behavior you've come to enjoy (new posts, discussions, and notifications)

⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀


Interested?
WebSockets is a premium extension exclusively available on Extiverse for $5/month. You can pick up a copy and learn how to install it here.

Now Free!

composer require kyrne/websocket

Issues or Suggestions?
If you run into any problems, have a suggestion, or just want someone to walk you through the install steps, don't hesitate to reach out to me on Discord @Kyrne #9728, and I'll be happy to help! I've also included a troubleshooting guide at the bottom of the page here.

    I noticed some errors with the new non-recurring plan @Kyrne set up. These have been resolved, @[deleted] tested this again and was able to subscribe. I've also fixed an issue with existing subscribers of older recurring plans trying to cancel. The extension page should now be able to show the plan you subscribed to instead of the latest active one. I will soon patch the page to show the latest one as well so you can more easily decide to resubscribe.

    If you still discover any issues feel free to DM me on discord.

    hrvoje_hr the benefit is that you could potentially horizontally scale in nodes and make one dedicated node responsible for the websockets. You can then vertically scale that node whenever you need. Or just keep it all on one node and scale upwards when needed. Remember that websockets aren't really that resource intensive, because it's mainly json/text going back and forth.

    • [deleted]

    Ralkage I can't see anywhere on the instructions how to install this extension via composer ?

      • [deleted]

      luceos Thanks. Token is active already as I have recache installed also.

      • [deleted]

      Hmm...

      Your requirements could not be resolved to an installable set of packages.
      
        Problem 1
          - Installation request for pusher/pusher-php-server (locked at 2.6.4) -> satisfiable by pusher/pusher-php-server[2.6.4].
          - kyrne/websocket 1.0 requires beyondcode/laravel-websockets 1.3 -> satisfiable by beyondcode/laravel-websockets[1.3.0].
          - kyrne/websocket 1.0.1 requires beyondcode/laravel-websockets 1.3 -> satisfiable by beyondcode/laravel-websockets[1.3.0].
          - kyrne/websocket 1.0.2 requires beyondcode/laravel-websockets 1.3 -> satisfiable by beyondcode/laravel-websockets[1.3.0].
          - Conclusion: don't install beyondcode/laravel-websockets 1.3.0
          - Installation request for kyrne/websocket ^1.0 -> satisfiable by kyrne/websocket[1.0, 1.0.1, 1.0.2].
      
      
      Installation failed, reverting ./composer.json to its original content.

        [deleted] make sure to remove flarum/pusher. If this is the case, try:

        composer require kyrne/websocket --update-with-dependencies

        It's likely the fact that you still have flarum/pusher installed @Kyrne we might need to set a conflict in composer for that?

          • [deleted]

          luceos I do have it installed, yes - will remove.

          • [deleted]

          Seems ok now

          phenomlab@vps:~/forum.phenomlab.com$ composer require kyrne/websocket
          Using version ^1.0 for kyrne/websocket
          ./composer.json has been updated
          Loading composer repositories with package information
          Updating dependencies (including require-dev)
          Package operations: 25 installs, 0 updates, 0 removals
            - Installing ringcentral/psr7 (1.2.2): Downloading (100%)         
            - Installing symfony/psr-http-message-bridge (v1.3.0): Downloading (100%)         
            - Installing symfony/http-kernel (v4.1.13): Downloading (100%)         
            - Installing react/promise (v2.7.1): Downloading (100%)         
            - Installing react/event-loop (v1.1.1): Downloading (100%)         
            - Installing react/promise-timer (v1.5.1): Downloading (100%)         
            - Installing react/cache (v1.0.0): Downloading (100%)         
            - Installing react/dns (v1.2.0): Downloading (100%)         
            - Installing paragonie/sodium_compat (v1.13.0): Downloading (100%)         
            - Installing pusher/pusher-php-server (v4.1.4): Downloading (100%)         
            - Installing symfony/routing (v4.1.12): Downloading (100%)         
            - Installing illuminate/http (v5.7.28): Downloading (100%)         
            - Installing illuminate/routing (v5.7.28): Downloading (100%)         
            - Installing illuminate/broadcasting (v5.7.28): Downloading (100%)         
            - Installing facade/ignition-contracts (1.0.0): Downloading (100%)         
            - Installing evenement/evenement (v3.0.1): Downloading (100%)         
            - Installing react/stream (v1.1.0): Downloading (100%)         
            - Installing react/socket (v1.4.0): Downloading (100%)         
            - Installing react/promise-stream (v1.2.0): Downloading (100%)         
            - Installing react/http-client (v0.5.10): Downloading (100%)         
            - Installing clue/buzz-react (v2.7.0): Downloading (100%)         
            - Installing ratchet/rfc6455 (v0.2.6): Downloading (100%)         
            - Installing cboden/ratchet (v0.4.2): Downloading (100%)         
            - Installing beyondcode/laravel-websockets (1.3.0): Downloading (100%)         
            - Installing kyrne/websocket (1.0.2): Downloading (100%)  
          • [deleted]

          • Edited

          Under PLESK, this is almost impossible to configure. Spent a couple of hours on this, but no dice. The real issue here is that PLESK does not put everything in the one file. I very much doubt I'm the only PLESK user here, so this might have to be taken into consideration.

          I should also add that PLESK has it's own socket server, so there is no need to create another. Obviously keen to get this working

            To anyone following along, I just solved @[deleted]'s issue. Turns out, I forgot to mention in the documentation that you have to run the included websocket server for it to all work. The documentation had been updated and will be live soon on Extiverse.

              • [deleted]

              • Edited

              Kyrne And I'm coming back here to

              • Thank @Kyrne for being available at stupid-o-clock because of our differing time zones
              • Let everyone know that if you are using plesk, you should go for Option 2 in the config (SSL handshake and cert pem). The reason for this is that plesk places NGINX config all over the place. It's tough to track down, and will be overwritten by updates as the files are generated dynamically.

              Additionally, plesk doesn't support @rebootin crontab -e and nohup doesn't exactly work very well either - even with respawn.

              Based on this, I had little choice other than to use a script that executes every 5 minutes. This looks like the below for anyone else who needs to use it

              #!/bin/bash
              cd /var/www/vhosts/phenomlab.com/forum.phenomlab.com
                    php flarum websockets:serve
              for pid in $(pgrep -f websockets.sh); do
                  if [ $pid != $$ ]; then
                      echo "[$(date)] : Websocket : Process is already running with PID $pid" | tee -a /var/www/vhosts/phenomlab.com/backup/websockets.log
                      exit 1
                  else
              	    echo "[$(date)] : Starting Websocket with PID $pid" | tee -a /var/www/vhosts/phenomlab.com/backup/websockets.log
                    php flarum websockets:serve
                  fi  
              done

              Obviously, substitute my paths above for your own 🙂

              Now onto the bit that matters. Websockets is fast. Like, superfast, doesn't send your JSON info off to another third party service you can't control, and is compliant with GDPR - an absolute MUST for my forum in particular.

              Don't forget to disable DEBUG when you're done 🙂