ratchetphp / Pawl

Asynchronous WebSocket client
MIT License
583 stars 84 forks source link

send message from php to websocket #145

Open daniel89fg opened 1 year ago

daniel89fg commented 1 year ago

Hello.

I have a connection created from javascripts successfully towards my websocket server. I send messages and receive the perfect response. I am using the cboden/ratchet library.

Now what I need is to save a message in the database, to be able to send a message from php to the websocket server so that it sends it to the chat. I can't do this.

I've tried the sample code but I can't do anything. Can you guide me a bit?

Thank you.

aguetkriegerisch commented 1 year ago

same situation x-x. php client connects successfully but suddenly get a "Connection closed" with code 1000 and the process does not listen to the 'open', 'message' or 'handshake' events; neither if I execute the method ->send() in the root of the callback of the Connector()->then() method