如何在php-engine上使用nodejs + socket.io

我不明白如何将nodejs + socket.io用于我的php引擎。</ p>


  1. 我有php-engine。</ li>
  2. 我的服务器安装了nodejs + socket.io </ li>
  3. 我不会 知道,如何从服务器socket.io上的php-script发送事件(json - pref。等),隐私政策。</ li>
    </ ol>

    或者,如何 用这个 ? 如果这不是PHP - 所以我如何采取用户名/用户名/图像?</ p>

    我在互联网上看到的所有脚本 - 没有安全性,任何人都不能使用他的用户名或用户名(只需更改) js),没有人不说,如何保护这个。</ p>

    也许你可以帮助我说这是怎么做的 - 用例子代码:)</ p>
    </ DIV>

展开原文

原文

I don't understand how to use nodejs+socket.io for my php engine.

  1. I have php-engine.
  2. I have server with installed nodejs+socket.io
  3. I'll don't know, how to send event (json - pref. etc.) from php-script's on socket.io the server, with privacy policy.

Or, how to use this ? if this is not php - so how i take userid/username/images?

All scripts what i see in the internet - without security and anyone can use not his username or userid (just change js), and nobody don't said, how to protect this.

Maybe u can help me and say how do this - with example code :)

dongziche8030
dongziche8030 jliphp-engine到网站,nodejs+socket.io用于实时事件,BagosGiAr是啊,坏英语,sry。
接近 8 年之前 回复
dpsx99068
dpsx99068 您对隐私政策有何看法?安全层?
接近 8 年之前 回复
dsnd7200
dsnd7200 我真的不明白你要做什么。你的服务器端代码是PHP还是node.js?
接近 8 年之前 回复

1个回答

Regarding the Security Layer, you should implement your own algorithm. I can't show you an example since it depends on your architecture.

IMHO, I suggest to Use Stomp over PHP & nodeJS. It is simple enough and can handle a great variety of messages (Most common is JSON-body-Messages).

To Scale this solution I would also suggest to Use activeMQ. ActiveMQ is a Message broker and it can help you to implement your security layer since it provides a SSL support over STOMP and a Username/password option.

This solution has been tested in real life to handle ~6k TPS.

Cheers!

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐