Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

lee__mason's avatar

Creating a websocket system without pusher or nodejs?

Hi guys and girls.

Loving the new event broadcasting in laravel and have used it in a few apps, its just awesome!

However im working on an app now that may become distributable opensource.

Now the key to this is making it easy to install, works pretty much everywhere etc.

The problem with this is pusher is a paid service (and requires signup even if it was free). And the socket.io/redis option requires more than your average shared hosting account will have setup by default (node js, redis, installing, proccess watching, etc).

Im keen to keep it accessible to people on shared hosting which gives me a dilema.

how in the hell am i going to create a websocket server, keep it running etc without requiring the end user to "set something up".

Initial thoughts are around the rachet php server but cant be sure.

The "app" will have a cronjob they need to setup so maybe have an artisan command which runs on a schedule and uses the symfony Proccess class to test if the rachet server is running and if not restart it?

anybody done anything like this before without using tools that require a: more setup, b: more complexity than your average end user?

0 likes
3 replies
KNietzsche's avatar

You can watch some tuto on youtube about how to install or use ratchet with Laravel... some are russians but videos with code are easily understandable. And if you use a VPS, you should be able to install it easily and then use it with our favorite framework.I must agree that in some cases, VPS seems to be the best choice for some applications with Laravel...but that's another topic...

hbmaddog's avatar

Why not use a basic droplet at digital ocean? They're cheap and then you can get away from the shared hosting environment...this way you have access to redis and won't reply on Pusher.

As for the user setting up their own CRON on your server...well, that could be a nightmare. They could make your server unresponsive. Just take caution of what you really want your users to be able to do...

Please or to participate in this conversation.