开发者

Integrating Google Talk to web app using strophe.js and punjab

I'm trying to integrate Google Talk (a.k.a. gtalk) into my web app. It's going to be a tight integration, so Google Talk chatback badge, and embedding Google's flash based web client using an iframe won't do the job.

I'll probably need to build the client from scratch if there is not already a HTML based client available on the web. After doing some research, I think the solution is to use strophe.js for the front-end and punjab as the middleware to communicate to Google Talk server. Does it sound about right? Is there any good blog post or tutorial that covers this topic?

For the front-end, will strophe.js be able to pull the contact list; as well as, the online status of the contacts? I'm trying to understand the big picture first before digging into any further. Right now, punjab is like a complete black box to me. It appears that there is not much setting up to do once it is in开发者_C百科stalled and running.

Any comments?


I first like to make certain I understand your question. I think we can understand your question in two ways, which will give you two completely different answers. If you want to have the same functionality as Google Talk chatback badge so that visitor of your website can chat with your Gtalk account(JID) then I think you should have a look at section B)

I think this link from strophe.js author is pretty interesting explaining "Which BOSH Server Do You Need"

A) You want to use Gtalk to chat with other users in your roster

http://web.archiveorange.com/archive/v/kjZWxPJeyGfVyAwpJnZm

Quote from Matthew Wild(Author prosody.im):

There's a difference between connecting to a remote server, and logging into a remote server. You indicated that you wanted to log into remote servers.

If you only want to send messages from local users using BOSH to remote users on other servers, ejabberd's mod_bosh is fine. If you want to allow your BOSH users to log into their own accounts other servers, you need to use punjab, or another connection manager (ejabberd is of no use if you aren't using it for logging into).

Hope this helps, Matthew.

B) You want the users visiting your site to chat with you

I don't think GTalk(Google) likes you to use Gtalk's server for your BOSH connections, so that other users visiting your website can talk to you. In that case I think you should have your own XMPP server. The nice thing about XMPP is that standard they are interoperable with other servers, so also to your Gtalk JID.

You could for example use the very nice prosody.im which also has BOSH built-in. Using strophe from prosody.im is very simple.

Professional XMPP

Furthermore I recommend you to read the book professionalxmpp to learn how to use strophe.js. You can read a preview from scribd.

For the front-end, will strophe.js be able to pull the contact list; as well as, the online status of the contacts? I'm trying to understand the big picture first before digging into any further. Right now, punjab is like a complete black box to me. It appears that there is not much setting up to do once it is installed and running.

I think you can your information at:

contact list => Chapter 6, Building the Roster => Requesting Rosters
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜