The Http service process actively sends messages to the ws service process.

on the same server ( Linux ), there is a http service built by PHP and a WS ( websocket ) service based on Workerman . How can the http service process actively send messages to this WS service process?

PS: PHP version 5.5.37 workerman version: 3.3.3

Mar.04,2021

in theory, it must be curl to operate. Upgrade to websocket through header to request
only the data to be submitted. This depends on the format of the data to be received by the WS protocol in workerman. I think you can use js to trigger ws to send messages, and then go to the backend log to see what format you receive


workerman documents have


http cannot send messages on your own initiative. Websocket is a new technology derived from this problem


the ws process can open a http interface (Nodejs's socket.io can be used with http if possible) and send the received data to websocket

.

php can directly request the newly opened http interface.

Isn't there an example of being a wsws client in the

workerman document? Refer to the examples in the document

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1be6142-30f50.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1be6142-30f50.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?