Joke Collection Website - Public benefit messages - How does PHP actively send information to the client?

How does PHP actively send information to the client?

To realize message push, firstly, the browser needs to support websocket protocol, which is the premise, and then the browser sends a websocket request to the server to establish a connection, so that the server can push messages to the browser through this connection.

Server-side support for websocket can be realized through some third-party libraries for reference.

Hoa/websocket webpage link

Swoole library