Here is my Apache config that works:

RewriteEngine on
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteRule /(.*) ws://127.0.0.1:2083/$1 [P,L]

ProxyPass /app/ http://127.0.0.1:2083/app/
ProxyPassReverse /app/ http://127.0.0.1:2083/app/
ProxyRequests off
  • HD3D replied to this.

    Kyrne

     Problem 1
        - kyrne/websocket[2.8.0, ..., 2.8.5] require guzzlehttp/psr7 ^1.5 -> found guzzlehttp/psr7[1.5.0, ..., 1.8.2] but it conflicts with your root composer.json require (^2.0).
        - Root composer.json requires kyrne/websocket ^2.8 -> satisfiable by kyrne/websocket[2.8.0, ..., 2.8.5].
    
    Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

      3.0.0

      👋 Presence Channels

      • Websocket now features a presence channel that is automatically subscribed to when viewing individual discussions (logged in users only!)
        • Typing indicators for those replying to discussions at the bottom
        • Shows users that are currently viewing a discussion on the side bar
        • Easy extending (see dev guide below)

      📈 Statistics (beta)

      • See how things are going with your websocket server
        • Peak connection and websocket message counters now on the dashboard of your admin page
        • Configurable interval for statistics to cater to your forum's traffic
        • Stats are automatically deleted after 10 days
        • There will be a blank box on your dashboard until you have your first statistic

      📓 Notes

      • The api changed a bit in this release, if you hook into websocket, take a look at the guide below
      • Statistics are only enabled for the non-Poxa server. While I didn't find any performance difference with stats on vs off, this is to keep Poxa as the most high-performance option
      • The chart may need to be tweaked in the future depending on feedback. If you can't see some data, or the scale is wrong, feel free to reach out to me

      ⬆️ Installing

      1. Shutdown your running websocket server
      2. Update the plugin composer update kyrne/websocket
      3. Run the migrations php flarum migrate
      4. Clear your cache php flarum cache:clear as well as any Cloudflare or other server caches
      5. Configure the stats interval on the websocket admin page
      6. Start the websocket server once again
      7. Wait for the first interval to pass and check the graph!

      🛠️ Dev Notes

      • You now have a dedicated way to access the pusher instance. Simply resolve the app.pusher promise and you will find the pusher instance directly on the returned value's .pusher key
      • Channels can now be found under that same value's .channel key
      • The presence channel can be accessed via app.discussions.presence, it is automatically updated with the discussion that the user is currently viewing (don't forget to bind to an event each time a new discussion is viewed!)

        Kyrne really awesome updated. Installed and tested. So far working without flaw 😆

        Kyrne hey kyrne this is amazing. Thanks for the big update.
        I haven't seen any other problems with the mobile except for a minor issue.

          mekici

          3.0.1

          • Fix mobile display issue
          • Added stats interval timing message when starting the websocket server (visual only, no need to restart the server after updating)

            Kyrne did you turn off mobile viewing? Because it is no longer visible.

              mekici I did, there's no good space to put it right now. I'll look into another place to put it, maybe under or on top of the mobile slider. For the future though.

              Typing indicator still works.

                3.0.3

                • Fix statistics saving
                • Reverse graph order
                • Fix flarum/statistics conflict

                Please restart the websocket server after updating!

                tuxmain Did you set up websockets with nginx reserve proxy + apache2?

                @Kyrne Can you provide a detailed guide/instructions how to make websockets work on nginx+acpahe2?

                  HD3D Apache will not have any effect on the setup of the websocket server using my methods. You will only need to utilize the nginx portion. Check the GitHub page for detailed instructions on how to set that up.

                  If you want to use Apache for it I cannot provide support, I've never attempted it and it doesn't seem like the best method to me as Apache wasn't built with proxy-ing in mind.

                  • HD3D replied to this.

                    Kyrne Ok thanks

                    I'm now using websockets with Option 2 - Websocket server handles SSL

                    Everything seems to work great but I'm noticing that my forum is hanging after a few minutes and becomes all discussions disappear, it can't be refresh by clicking on the forum logo but only by refreshing the browser's refresh button and then it works for a few minutes and so on

                    Also, After running php flarum websocket:serve it is running for minutes, am I suppose to just close the putty like that?

                    Below is the screenshot of putty constantly running for minutes after running php flarum websocket:serve command

                    Edit:
                    I notice that my server is getting automatic restart
                    These are the console errors when forum goes on blank and refresh mode

                    Edit2:
                    Another issue I'm facing is that websockets runs only if I run "php flarum websocket:serve" command in putty and let it run, websockets stops working as soon as I close putty

                      HD3D The php flarum websocket:serve command needs to run constantly. The websocket does not work because the nu command stops working as soon as you exit the console. There are several ways to make this command run continuously. I am using Supervisor. I advise. https://flarumtr.com/d/2293-flarumda-supervisor-usage Here I have explained the supersisior setup and its configuration for websocket. But Turkish.

                      https://discuss.flarum.org/d/28052-realtime-self-hosted-websocket-for-instant-updates You can also check this for supervisor usage.