最好的方式来实时聊天PHP?

i already create website with nodejs as server side, i successful transfer data from server to client,,i use nodejs in main page only, in another page i make use php,my problem is how i merger main page (use node.js) and another page (php) so that page (node & php) can communicated..

for example, i have chat box in main page(nodejs) and another page (php) also have chat box. user A active in main page and send message to user B active in another page(php),i want to communicate user A and B. its possible to do that?

thanks,

Build a module, that has it's own backend. The clientside module is written in pure javascript and can be integrated in every frontend. Message will be send with ajax or websockets (socket.io).

The backend is just a transport layer to broadcast messages to chat members.

Yes you can use node.js, jquery, php to achieve real time chat. i was able to do that using those three, a chat room and a personal message chat also.

Actually it works like this, NODE JS will be your server getting all the session of the connection, Javascript as your front-end that will communicate with the server (NODE JS using websocket emit, broadcast and etc) and php/html for creating UI's and saving messages.