How to make php and nodejs?

Please tell me how you can pass data from php to node.js and back.

In node I data from php could pass through the project

But how back ?
October 3rd 19 at 01:40
7 answers
October 3rd 19 at 01:42
October 3rd 19 at 01:44
to be honest I even confused what to use. Describe the problem, it may be something specific:

I write gaming portal, where users can play with each other, for example checkers. The whole site is implemented in Yii, and game on node.js. Now how it looks and what I need.

For example, the user on the website creates for the game, 2 user subscribes to the application (here the authority over yii) next, you need to transfer data about these user node.js where the game starts.

I'm working with a mysql database so I think that the radishes I don't need. For example, in node.js I pass the user_id of the user and application id. Further, it is already on the server node.js using I form room for two players and they play. After completing the game, I need to throw data back in php , namely information about the victory, then php will consider the rating and TP.

To send data to node.js I was able with the help of, but a simple post request. Everything works as it should, but is it safe ? Can I intercept somehow the data and to replace on your own ? would be a shame if the player loses and the submenu data in such a way that he is a winner.

Actually the problem is I have this and I honestly got lost between the options.
can email how to send post requests to the server? - kareem.Hans commented on October 3rd 19 at 01:47
October 3rd 19 at 01:46
October 3rd 19 at 01:48
you can open a tcp connection, some code, and already a full-fledged exchange rate data, + adds the ability to "communicate" to a variety of programs that bish is not dependent on some library, and tcp client in any language to implement real.
October 3rd 19 at 01:50
I have used redis, but he's got a subscription, etc. for events. Maybe you will fit
October 3rd 19 at 01:52
Maybe node.js she will record information about the results in the Database? And then PHP will be easier - only to find it out and display...
October 3rd 19 at 01:54
so you need to give a signal node that OA would start to work. This is decided using the the post back request.
Why not read through the elephant. Like the read method in the API is present. - kareem.Hans commented on October 3rd 19 at 01:57

Find more questions by tags Node.jsPHPSockets