XMPP for PHP (how to do it)

2019-08-17 01:33发布

First I'll outline my problem.

What I want to do is create a site. When a client connects, every second or so a number will be broadcast by him.

This is done by everybody on the site.

So every second every client receives every other clients number.

My Solution (that isn't currently making sense)

I thought of using XMPP and an OpenFire server to do this, but I can't seem to make it work with PHP.

Finally the question

  1. Is there a better way to solve my problem than the one I outlined? Another potocol or something?

  2. Is there something that'll play nicely with OpenFire

I already looked at these

http://code.google.com/p/xmpphp/

https://github.com/tong/hxmpp/

标签: php xmpp
2条回答
趁早两清
2楼-- · 2019-08-17 02:08

Read this http://belski.net/archives/37-Phurple-for-PHP-5.3-and-up.html

You can make it work with PHP+XMPP using the phurple extension. It works upon libpurple which is the base for Pidgin. That will make you able to work with many other protocols as well, XMPP will already enable Facebook, Google and any other XMPP based.

查看更多
\"骚年 ilove
3楼-- · 2019-08-17 02:10

and Happy new Year,

XMPP, is the most common way with dealing with notifying problems, but yet you can use a less heavy approach (Technique) to deal with your problem which is Pushlets, and for sure the previous link is not the only one. Pushlets area servlet-based mechanism where data is pushed directly from server-side to (Dynamic) HTML pages within a client-browser. This allows a web page to be periodically updated by the server. and sure it's much lighter than XMPP.

you can also use it with Java server side like in Here, which will give you some new ideas.

anyways, if you have a web application which has a lot of users you have to think twice then. and make sure that XMPP gives you a lot of controlling features over many requests. When pushlet is good enough to do your broadcasting.

Hope that will help you.

查看更多
登录 后发表回答