什么是strophe以及如何将它与JQuery一起使用? [英] What is strophe and how to use it with JQuery?

查看:116
本文介绍了什么是strophe以及如何将它与JQuery一起使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我相信这与XMPP有关系吗?



有人可以解释什么是strophe?如何将它合并到使用Jquery的站点中?

解决方案

Strophe不是Jabber客户端,它不是XMPP客户端。它是一个库,可以让你轻松地编写其中任何一个。您可以(非常困难)用JavaScript或Jquery从头开始编写Jabber / XMPP客户端,但想象这样生成和发送XML是非常困难的:

 < body xmlns ='http://jabber.org/protocol/httpbind'sid ='e4fcc09444a61059e88296a106e86e1ff1454f9b'wait = '60'requests ='2'inactivity = '30'maxpause ='120 'polling ='2'ver ='1.8'from ='localhost'secure ='true'authid ='1027072784'xmlns:xmpp ='urn:xmpp:xbosh'xmlns:stream ='http://etherx.jabber。 org / streams'xmpp:version ='1.0'>< stream:features xmlns:stream ='http://etherx.jabber.org/streams'>< bind xmlns ='urn:ietf:params:xml :NS:XMPP协议捆绑'/> 



Strophe是一个Javascript库这些功能使编写XMPP客户端的过程变得更加简单。它有方法允许您连接到服务器,向用户发送消息,添加联系人 - 并且它知道需要发送到服务器以执行这些操作的XML。它基本上完成了所有困难的工作 - 为您生成,发送,连接和沟通XML。这让你的生活变得更加轻松。


Can somebody explain what strophe is?

I believe it has something to do with XMPP?

How can I incorporate it into a site using Jquery?

解决方案

Strophe is not a Jabber Client, and its not an XMPP client. Its a library that allows you to easily write either of these. You could (with great difficulty) write a Jabber/XMPP Client from scratch using Javascript or Jquery, but this would be very difficult imagine generating and sending XML like this:

<body xmlns='http://jabber.org/protocol/httpbind' sid='e4fcc09444a61059e88296a106e86e1ff1454f9b' wait='60' requests='2' inactivity='30' maxpause='120' polling='2' ver='1.8' from='localhost' secure='true' authid='1027072784' xmlns:xmpp='urn:xmpp:xbosh' xmlns:stream='http://etherx.jabber.org/streams' xmpp:version='1.0'><stream:features xmlns:stream='http://etherx.jabber.org/streams'><bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'/>

Strophe is a library of Javascript functions that makes the process of writing an XMPP client easier. It has methods to allow you to connect to a server, to send a message to a user, to add a contact - and it knows about the XML that needs to be sent to the server to carry out these actions. It basically does all the difficult stuff - the XML generating, sending, connecting and communicating stuff for you. Which makes your life a whole lot easier.

这篇关于什么是strophe以及如何将它与JQuery一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆