prosody相关概念了解。xmpp,jabber,bosh等

邵昆琦
2023-12-01

目录

BOSH定义

prosody定义

XMPP

Differences Between Core Jabber Protocols and XMPP

参考文档


BOSH定义

BOSH is “Bidirectional-streams Over Synchronous HTTP”, a technology for two-way communication over the Hypertext Transfer Protocol (HTTP). BOSH emulates many of the transport primitives that are familiar from the Transmission Control Protocol (TCP). For applications that require both “push” and “pull” communications, BOSH is significantly more bandwidth-efficient and responsive than most other bidirectional HTTP-based transport protocols and the techniques known as AJAX. BOSH achieves this efficiency and low latency by avoiding HTTP polling, yet it does so without resorting to chunked HTTP responses as is done in the technique known as Comet. To date, BOSH has been used mainly as a transport for traffic exchanged between Jabber/XMPP clients and servers (e.g., to facilitate connections from web clients and from mobile clients on intermittent networks). However, BOSH is not tied solely to XMPP and can be used for other kinds of traffic, as well.

prosody定义

Prosody is a modern XMPP communication server. It aims to be easy to set up and configure, and efficient with system resources. Additionally, for developers it aims to be easy to extend and give a flexible system on which to rapidly develop added functionality, or prototype new protocols.

 

Ports
The image exposes the following ports to the docker host:

80: HTTP port
5222: c2s port
5269: s2s port
5347: XMPP component port
5280: BOSH / websocket port
5281: Secure BOSH / websocket port
Note: These default ports can be changed in your configuration file. Therefore if you change these ports will not be exposed.

XMPP

XMPP(Extensible Messaging and Presence Protocol,前称Jabber)协议介绍

可扩展消息处理现场协议(eXtensible Messaging and Presence Protocol , XMPP) 是一种基于可扩展标记语言(eXtensible Markup Language, XML)的近端串流式即时通信协议。它将现场和上下文敏感信息标记嵌入到XML 结构化数据中, 使得人与人之间、应用系统之间以及人与应用系统之间能即时相互通信
XMPP是一种基于XML架构的开放式协议.XMPP的基础部分已经在2002-2004年得到了互联网工程任务组(IETF)的批准,未来XMPP协议会理所当然的同Internet协议TCP/IP、HTTP、FTP、SMTP、POP一样成为Internet标准。

Xmpp协议内容

XMPP中定义了三个角色,客户端,服务器,网关。通信能够在这三者的任意两个之间双向发生。服务器同时承担了客户端信息记录,连接管理和信息的 路由功能。网关承担着与异构即时通信系统的互联互通,异构系统可以包括SMS(短信),MSN,ICQ等。基本的网络形式是单客户端通过 TCP/IP连接到单服务器,然后在之上传输XML。

XMPP代表eXstensible Messaging and Presence Protocol."可扩展"部分很重要.XMPP基于XML,这是一种支持称为命名空间概念的数据格式.

通过命名空间,您可以向XMPP添加未在原始规范中定义的位.这很重要,因为XMPP规范只是故意描述一组核心内容,例如:

  • 客户端如何连接到服务器
  • 加密(SSL/TLS)
  • 认证
  • 服务器如何相互通信以传递消息

......以及其他一些基本构建模块.

一旦你实现了这个东西,你有一个XMPP客户端,可以发送你喜欢的任何类型的数据!但这也是一个问题.

例如,您可能决定要在消息中包含格式(粗体,斜体等),这在核心XMPP规范中未定义.好吧,你可以想办法做到这一点,但除非其他人都像你一样做,否则其他任何软件都无法解释它(他们只会忽略他们不理解的命名空间).

因此,XMPP标准基金会(XSF)发布了一系列额外文档,称为XMPP增强建议(XEP).通常,每个XEP都描述一个特定的活动(从消息格式化到文件传输,多用户聊天等等),它们为每个人提供了用于该活动的标准格式.

Differences Between Core Jabber Protocols and XMPP

XMMP改编自Jabber开源社区的Jabber草案,所以,你可以把Jabber看做是XMPP0.9。由于已经存在了大量的Jabber的实现,所以说明一下Jabber和XMPP的区别是非常有必要的,同时也能加快个鼓励这些基于Jabber的实现升级到XMPP

参考文档

 XMPP | An Overview of XMPP

Welcome – Prosody IM

XMPP——xmpp协议详解、优点、缺点及优化思路 - jessonlv - 博客园

xmpp和jabber的区别_booooooooooooooooooo的博客-CSDN博客

这个比较全:

XMPP | Specifications

这个是一单的解析

XEP-0100 XMPP网关接口协议_庐山西海的博客-CSDN博客

 类似资料: