Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bi direction web socket communication #1

Open
moneya opened this issue Dec 3, 2023 · 3 comments
Open

Bi direction web socket communication #1

moneya opened this issue Dec 3, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@moneya
Copy link

moneya commented Dec 3, 2023

Hi, I would to know if this supports bi-directional communication via websocket.

  • client to client
  • client to server.

I currently use laravel websocket but would like to switch to swoole.

If yes, can you point me to a documentation for that?

do you support custom route base channels?

i currently use laravel websocket to handle that.
https://beyondco.de/docs/laravel-websockets/advanced-usage/custom-websocket-handlers

@roberto-butti roberto-butti added the enhancement New feature or request label Dec 3, 2023
@roberto-butti
Copy link
Contributor

Thank you, @moneya, for your interest.
This PoC (proof of concept) currently implements a simple broadcast, that is, the client sends a message to the server, and the server takes care of delivering this message to all connected clients (broadcast).
The client-client communication should still go through the server specifying the recipient. It is possible to redefine the default WebSocketHandler by extending the WebSocketHandlerInterface interface. To set a new WebSocketHandler you can use the setWebSocketHandler method in the LaraSockCommand.

Honestly, I had slowed down the development of this PoC because of the little feedback I received. But if there is interest, it can be resumed.

@moneya
Copy link
Author

moneya commented Dec 3, 2023

Well, does this work with pusher package / protocol?
In pusher there's this .whisper() function we using for (user is typing).
I think that's client to client.

And so client to server works and server to client works right now?.

Do I need a route , like the below to register an handler?

WebSocketsRouter::webSocket('/my-websocket', \App\MyCustomWebSocketHandler::class);

And what about security?

@moneya
Copy link
Author

moneya commented Dec 3, 2023

I have been following this project for a while, since you started.
But didn't checkback until now.
And yes am interested in this project.
I need a swoole alternative to laravel websocket package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants