Adding Node.js (for real-time notifications) to an existing PHP application

前端 未结 2 555
抹茶落季
抹茶落季 2021-01-30 11:55

I have an existing PHP application, to which I need to add realtime notifications. In order to achieve this I have installed node.js (intending to add socket.io for all real ti

2条回答
  •  生来不讨喜
    2021-01-30 12:10

    This question is old but I found it when I was trying to implement websockets so maybe this will help someone else who needs a pure PHP solution which can be integrated into an existing project without too much hacking around.

    Ratchet - PHP WebSockets

    Only requirement is the zmq binding for PHP, which is used as the method to pass data from your PHP scripts to your websocket server. If your PHP instance isn't built with it then you can find it here

    Github repo is here, plenty of examples to get you going are here

提交回复
热议问题