使用 strope.js 和旁遮普语将 Google Talk 集成到网络应用程序

发布于 2024-11-25 23:26:26 字数 394 浏览 0 评论 0原文

我正在尝试将 Google Talk(又名 gtalk)集成到我的网络应用程序中。这将是一个紧密的集成,因此 Google Talk 聊天徽章以及使用 iframe 嵌入 Google 基于 Flash 的 Web 客户端无法完成这项工作。

如果网络上还没有可用的基于 HTML 的客户端,我可能需要从头开始构建客户端。经过一些研究,我认为解决方案是使用 strope.js 作为前端,使用 punjab 作为中间件与 Google Talk 服务器进行通信。听起来正确吗?有没有涵盖该主题的优秀博客文章或教程?

对于前端来说,strope.js 能拉取联系人列表吗?以及联系人的在线状态?在进一步深入研究之前,我试图先了解大局。现在,旁遮普对我来说就像一个完整的黑匣子。一旦安装并运行,似乎不需要做太多设置。

有什么意见吗?

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 installed and running.

Any comments?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

月隐月明月朦胧 2024-12-02 23:26:26

我首先想确定我理解你的问题。我想我们可以用两种方式来理解你的问题,这会给你两个完全不同的答案。如果您想拥有与 Google Talk 聊天徽章 相同的功能,以便您网站的访问者可以与您的 Gtalk 帐户 (JID) 聊天,那么我认为您应该看看 B 部分)

我认为 strope.js 作者的这个链接非常有趣,解释了 “您需要哪个 BOSH 服务器”

A) 您想使用 Gtalk 与名册中的其他用户聊天

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

引用 Matthew狂野(作者prosody.im):

连接到远程服务器和连接到远程服务器之间是有区别的
登录远程服务器。您表示您想登录
到远程服务器。

如果您只想使用 BOSH 将本地用户的消息发送到
其他服务器上的远程用户,ejabberd 的 mod_bosh 就可以了。如果你
希望允许您的 BOSH 用户登录他们自己的帐户
服务器,您需要使用旁遮普语或其他连接管理器
(如果您不使用 ejabberd 登录,则 ejabberd 没有任何用处)。

希望这有帮助,马修。

B) 您希望访问您网站的用户与您聊天

我认为 GTalk(Google) 不喜欢您使用 Gtalk 的服务器进行 BOSH 连接,以便其他访问您网站的用户可以与您交谈。在这种情况下,我认为您应该拥有自己的 XMPP 服务器。 XMPP 的优点是它们可以与其他服务器互操作,也可以与您的 Gtalk JID 互操作。

例如,您可以使用非常好的 prosody.im,它也内置了 BOSH。使用 prosody.im 中的 strope 非常简单。

专业XMPP

此外,我建议您阅读professionalxmpp这本书来学习如何使用strope.js。您可以从 scribd 阅读预览。

对于前端来说,strope.js能拉取联系人列表吗?
以及联系人的在线状态?我正在努力
在进一步深入研究之前,首先要了解大局。
现在,旁遮普对我来说就像一个完整的黑匣子。看来
安装并运行后,无需进行太多设置。

我认为您可以在以下位置获取信息:

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

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文