S
S
Serik2014-08-30 23:05:08
PHP
Serik, 2014-08-30 23:05:08

How to pass a command from PHP to NodeJS and vice versa?

Background
Previously, the site used only PHP and all requests went through Ajax. Now NodeJS for WebSockets (socket.io) has been added.
Question
How to transfer data array from PHP to NodeJS?
On the example of a chat: on some events, the server sends a message to the chat to the user (adds an entry to the database), at this moment you need to send this message to the user from NodeJS.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2014-08-30
@SerikDM

You need a data bus. Arm yourself with message queues (ZeroMQ, RabbitMQ, ActiveMQ, etc.)

T
TANK_IST, 2014-08-30
@TANK_IST

I also struggled with this issue, eventually installed Ratchet and used WebSocket in PHP.
Works great!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question