laravel / reverb

Laravel Reverb provides a real-time WebSocket communication backend for Laravel applications.
https://reverb.laravel.com
MIT License
1.02k stars 71 forks source link

Adding the "emit" feature from the client to the server. #161

Closed enayatinfo closed 4 months ago

enayatinfo commented 4 months ago

Hello! Thank you for your amazing package. Currently, this package operates events to be sent only from the server to the client. Do you have any plans to implement a feature that enables sending events from the client to the server?

Currently, I receive messages on the backend using an event listener on MessageReceived event. However, this approach increases resource consumption because it rechecks all sent events on the event listener. By adding PrivateMessageReceived and PresenceMessageReceived events to the package we can validate sent messages more efficiently.

For now, I need to receive events from private channels in backend, and user authentication isn't available. That's why I'm currently studying the source code of this package to find an optimal solution.

joedixon commented 4 months ago

Hey @enayatinfo we don't currently have plans for that as it's only really possible if you have Reverb running alongside your application and not if you are running a seperate server just for WebScokets which is pretty common.