tlaverdure / laravel-echo-server

Socket.io server for Laravel Echo
MIT License
2.64k stars 509 forks source link

Mqtt as socket client instead of socket.io #521

Open muresanandrei opened 4 years ago

muresanandrei commented 4 years ago

Since socket.io µWebSockets are deprecated I propose to use mqtt.

Reason to use mqtt it's because it is the fastest socket for real time, facebook uses it for chat. Also MQTT is specifically designed for applications like sending telemetry data to and from space probes, so it is designed to use bandwidth and batteries sparingly.

If you change to mqtt the difference in speed and connections allowed will be increased dramatically without needing more resources. And implementing mqtt it's pretty similar to socket.io. Mqtt is available for node and js so for frontend side it won't be a big change just to replace socket io client with mqtt.

I can try to implement it make a pull request but I would need some help to make the implementation respect the way code structure is right now with socket.io. If we do this than this library will be future proof and can become one of the best library for real time.

What do you think ?