Overview of Jabber Protocol

zhaozj2021-02-16  54

Overview of Jabber Protocol

Peter Saint-Andre

STPETER@jabber.org

1.4 Overview of the JABBER Service Agreement

1 Introduction

Jabber is a system that initiates and leads a real-time message and online status of an open source community. A functional difference in the Jabber system and other instant messaging (IM) services is that Jabber has an open XML protocol. Add some necessary extensions on the basis of maintaining the Jabber1.0 version of the status of the message core and online status. This document describes the Jabber protocol of the Jabber server version 1.4.

In the data stream of XML context, the open XML protocol of Jabber includes three top XML elements:

l

l

l (info / query)

Each element contains a large amount of data through the attribute and namespace, which is part of the Jabber (but not included for special applications). The entire JABBER protocol will be described below. If you want to get information about the Jabber system structure, see the document called Jabber technology (http://docs.jabber.org/general/html/overview.html).

2. XML stream

A Jabber session consists of two parallel XML streams, one from the client to the server, and the other from the server to the client. When a Jabber client is connected to a Jabber server, this client will initiate an XML stream of a client-server, while responding, the server will also initiate a server-client XML stream. All , , and elements are placed in the context of these XML streams. There is an example below:

Send:

1.0 "

Encoding = "UTF

-8"

?>

Send:

Send: to = 'jabber.org'

Send: XMLns = 'Jabber: Client'

Send: XMLns: stream = 'http: //ether.jabber.org/streams'>

Recv:

RECV: XMLns: stream = 'http: //etherx.jabber.org/streams'

Recv: id = '39aba7d

2'

RECV: XMLns = 'Jabber: Client'

Recv: from = 'jabber.org'>

(XML for User Session Goes HERE) *

Send:

Recv:

* Note: You must wait until a element (especially a 'Jabber: IQ: Auth' name space element) sends the authentication information, the server will agree to the user session work.

3. element

element is one of the three top elements of the Jabber open XML protocol. It is used to include two Jabber users to send message content, or more messages between two Jabber IDs (because through a magical transmitter, another IM system can be replaced by Jabber ID, such as 70902454 @ ICQ. Jabber.org).

3.1. Message Type - "Type" attribute Jabber supports several different messages, which distinguishes through the "Type" property of . Below is the valid value of the "type" property:

3.1.1

[default] (do not set "Type" attribute)

Indicates that this message is a normal message. By default, the client is set to normal messages when there is no properties.

example:

wherefore art thing romeo?

3.1.2

.type = "chat"

Indicates that the message needs to be displayed on the chat interface (generally a connection interface, but the actual interface can be defined by the user.)

example:

wherefore art thing romeo?

3.1.3

.type = "error"

The indication message is described as an error condition. The actual error is described in the message in a element. A element includes a and one . The following example will demonstrate that when Juliet is sent to a "hi" message for a user:

example:

TO = "juliet@capulet.com"

From = "flomeo@montague.net"

TYPE = "Error">

hi

Not Found

3.1.4

Type = "groupchat"

This message needs to be displayed in the interface of a chat room.

example:

Double, Double Toil and Trouble

3.2. Other properties

In addition to setting the "Type" property, you can also modify the element by the following attribute:

3.2.1

"From" attribute

Message sender's logo. Overall, the "from" of the Jabber ID must be the format of User @ host / resource. From XML's point of view, this attribute must be included in all elements, in order to deal with some spoof, actual application, the server adds or replaces this property. Therefore, it is not a problem that client developers need to care.

example:

Wherefore Art THOU Romeo?

3.2.2

"Id" attribute

The "ID" attribute is a unique sign as a message. It is generated by a Jabber client or a client library (similar to WinJab or Jabbercom), the client is used to use it for tracking messages (such as information that will be sent to a group chat room and the message received from this chat room, or The message is identified with the error that it might generate. The "ID" attribute is optional and is not available in other components of the system.

example:

Wherefore Art THOU Romeo?

3.2.3

"TO" attribute

Referring to the message. The "To" attribute of the Jabber ID is usually User @ Host / Resource format, and User @ Host can also be accepted. If the recipient is online, the user is solved by user @ host / resource, if the user is not online, send offline memory directly. This attribute is all of all elements.

example:

Wherefore Art THOU Romeo?

Pi Elements in Message />

The following sub-elements are used to define a context or data element of a Jabber message.

3.3.1

This element contains the main text of the message. The element exists only in a element, and can only contain plain text. However, it can be composed of other sub-elements (such as , ).

3.3.2

.

This element will be used when the message type property is set to "Error". The error code is defined by a "type" property. This "Type" property contains the number of code, and contains a text description of this error via element. element must be included in the of the original message. The following example will demonstrate that when Juliet sends a "hi" message to a non-existing user:

example:

TO = "juliet@capulet.com"

From = "flomeo@montague.net"

TYPE = "Error">

hi

Not Found

There is an illegal code in the attachment and the meaning of the meaning defined.

3.3.3

.

element combines XHTML namespace (http://www.w3.org/1999/xhtml), provides a message with a message, just like in the Email world, simultaneous sending normal text and HTML version The email message is the same. This feature is used by W

3C

The basic XHTML format (http://www.w3.org/tr/xhtml-basic/) jabber.org/draft-proto/html/xhtml.html). All XHTML root elements must be . In this root element, it supports elements defined in any basic XHTML format, but not each element can be understood by instant messaging. 3.3.4

This is an optional element that contains the title of the message.

3.3.5

When a Jabber client sends a "chat" type message, the unique thread ID is generated (usually a HASH generated by the sender's Jabber ID and the current time). Message senders and recipients in the chat contain a sub-element, which contains the original thread ID. This allows the message sender and the recipient to authenticate and create a conversation thread. The following is the example:

From = "juliet@capulet.com/balcony"

TO = "romeo@montague.net/orchard"

TYPE = "chat">

AAC96FEFDE

226C

2C

04be

8f

2E

19A

2151B

art thing romeo and a montague?

From = "romeo@montague.net/orchard"

TO = "juliet@capulet.com/balcony"

TYPE = "chat">

AAC96FEFDE

226C

2C

04be

8f

2E

19A

2151B

neither, fair saint, if Either the dislike.

3.3.6

element is used as an extension mechanism, or sends a command to the client from the server, or send a command from one client to another. Each time you use this element, you must indicate the related XML namespace. Single messages can contain multiple sub-elements instances. The following known namespaces can be used by the sub-element:

l jabber: x: autOUpdate

l jabber: x: delay

l jabber: x: encrypted

l jabber: x: OOB

l jabber: x: roster

These namespaces are more fully described in the Jabber namespace below.

Here is an example of display context using Jabber: x: DELAY namespace in the joined group chat room:

Type = 'groupchat'

From='cauldron@conference.witches.org '>

thrice the brinded cat hath mew'd.

Stamp = '10541031t21: 43:

40 '

> Cached in GC History

4. element

Elements provide availability information about a Jabber entity. Any entity confirmed by a Jabber ID can communicate with another entity online status information, which is mostly performed in a manner that subscribes to online status information.

All entities showing online status is not "available" is "unavailable". "Available" status indicates that the sender can receive a message immediately. The "unavailable" state indicates that the sender cannot receive any data at the current time. By default, all elements are "available" unless there is a type = "UNAVAILABLE" attribute. More special situations "available" are specified by and sub-elements.

4.1. "Type" attribute

"Type" attribute is used according to different purposes. In addition to prompting "normal" usage of other users' availability status of users, subscriptions, unsubscribe, and probe online status information. Below is the available value of the "Type" property:

4.1.1

Type = "available"

If there is no "Type" property, the online status package will be set to type = "available" to provide information when the user is online. A Type = "Available" online status package typically contains a element to detail the available type of the Jabber entity, and a element that contains a description of the available types of useful types. The online status package can also contain a element to indicate the priority of the Jabber ID of the connection.

example:

From = "juliet@capulet.com/balcony"

TO = "romeo@montague.net/orchard" />

Away

Stay But A Little, I Will Come Again.

Element is available:

l Away - Jabber user or entity online, but can not contact it immediately

l chat - jabber users or entities and have fun chat

l DND - Jabber user or entity online, but do not want to be disturbed ("DND" means "do not disturb")

l XA - Jabber user or entity online, but has left for a long time ("XA" means "extended Away")

can include any feature data, which typically contains a description of the user state, such as a performance value of "Away", or "busy encoding" can be an expression of "DND".

4.1.2

Type = "error"

When an online status package is sent to a non-existing JID, the server will return a Type = "error" online status package when an error occurs when an error is sent when the online state request is sent.

Here is an example (pay attention to the type of domain name):

TYPE = "Subscribe"

TO = "romeo@montague.nett" />

Reply example:

From = "romeo@montague.nett"

TO = "juliet@capulet.com/balcony"

TYPE = "Error">

> Remote Server Timeout. Unable to Deliver

Packet.

4.1.3

Type = "probe"

An online status information request is issued to a particular entity (entity cannot send online status messages). Server instead of the client, performing a probe request. In fact, although the Jabber client also sends a request to detect whether a Jabber user is online, it is usually a server-side issuance request. Note that the server will issue a probe only when the user of the user is requested by the user requesting the request. In the following example, we will see our hero Romeo issued a probe request to Juliet, and the server where the Juliet is located reply to a "status report package" (including Jabber: x: DELAY name space indicated last online status update time) stamp)

Exploring the request:

From = "romeo@montague.net"

TO = "juliet@capulet.com"

TYPE = "probe" />

Reply to the example of the request:

From = "juliet@capulet.com/."

To = "romeo@montague.net">

Stay But A Little, I Will Come Again.

Away

XMLns = "jabber: x: delay"

From = "juliet@capulet.com/."

Stamp = "15310309T23: 47: 15" />

4.1.4

Type = "subscribe"

Send a request, this request is that the recipient automatically sends online status information to the sender when it changes its online state.

example:

From = "romeo@montague.net"

TO = "juliet@capulet.com"

TYPE = "subsiscribe" />

4.1.5. Type = "subsiscribed"

Send a message indicating that the sender accepts a request for recipients to reproduce status subscriptions. From now on, when the sender's online status information changes, the server will send the status information to the recipient.

example:

From = "juliet@capulet.com"

TO = "romeo@montague.net"

TYPE = "subsiscribed" /> 4.1.6

Type = "unavailable"

example:

From = "juliet@capulet.com"

TO = "romeo@montague.net"

Type = "unavailable">

disconnnected

4.1.7

Type = "unsubscribe"

Send a request indicating that the recipient stops sending an online status information to the sender.

example:

From = "juliet@capulet.com"

TO = "romeo@montague.net"

Type = "unsubscribe" />

4.1.8

Type = "unsubscribed"

This type of online status package has two uses:

1. Send a notification indicating a request for the sender to accept the recipient for requests that do not subscribe to its online status information. The server will no longer send the sender's online status information to the recipient.

2. Reject a subscription request. The server will no longer send the sender's online status information to the user attempt to subscribe to its online status information.

example:

From = "romeo@montague.net"

TO = "juliet@capulet.com"

TYPE = "unsubscribed" />

4.2. Other Properties

In addition to setting the "Type" property, you can also modify the element by the following properties:

4.2.1

"From" attribute

Identify the sender of the online status package. The general jabber ID must be written in the format of User @ host / resource in the "From" property. From XML's point of view, this attribute is necessary for all elements, and in practical applications, the server adds and modifies the property (prevent some deception means), so client developers are not Need to consider it.

example:

4.2.2

"Id" attribute

A unique verification is configured for the online status request package. The "ID" property is generated by the Jabber client or client library (such as Gabber or Jabbercom), and the client is verified by the trajectory of the online status package. The "ID" attribute is optional and cannot be used anywhere elsewhere.

example:

4.2.3

"TO" attribute

Logo the recipient of the online status package. General Jabber IDs are in the "to" attribute. User @ host / resource format, the format of the user @ Host is also possible, but when the recipient is online, it will be converted to user @ host / resource. In the general usage of Jabber, the Jabber client issues an online status package to the server, and the server sends these online status packages to all users on the user. When a "to" property is not included in the element sent by a Jabber client, the server will convert it to the specified Jabber entity in the online status package. The following example will demonstrate this process. An example of an online status sent to the server:

Stay But A Little, I Will Come Again.

Away

The server sends an online state example of the specified user:

TO = "romeo@montague.net/orchard"

From = "juliet@capulet.com/balcony">

Stay But A Little, I Will Come Again.

Away

4.3. child elements

The following elements are used for the protocol.

4.3.1

In Jabber, a user can establish the same number of connections based on the number of devices or positions known in Jabber. The user can give each resource to a digital priority (by setting the Jabber client assigned to the resource), this priority is communicating with the child element method of the element.

When the online status package is sent to the server, the server has the ability to determine which connection resource needs to assign a single Jabber ID, which will receive a message sent to the Jabber ID, because the highest number of resources is default or the first Resources. If the highest priority resource is unavailable, messages and other Jabber communications will be sent to the second high priority resource (when other resources are not available, a client without priority from the default number to 0 can also be the first Resource)

For example, Julie can connect her account juliet@capulet.com through two resources: The Balcony and The Chamber of THE Chamber. If the priority of the "Balcony" resource is set to "

2

"

And the priority of "chamber" resources is set "

1

"

And both resources can be connected, and the message will be sent to juliet@capulet.com/balcony, not juliet@capulet.com/chamber.

4.3.2

Optional elements tell the Jabber client how to display a user's online status. The tag is a typical tag accompanying label, the tab contains more online status to change the reason for the reason. If the element is not in the element, the Jabber receives the client indicates that the user is in a "normal" state. Here are four options:

Label meaning chat This customer can contact Away This customer is online, but just left (such as lunch, sitting) Xa This customer is online, But it is already in a non-active state for a long time. DND This user is in a refused to disturb mode 4.3.3

.

The element contains more descriptions of the user online state. Most Jabber clients contain default settings for elements; in addition, we also allow us to provide personality description such as "I am having lunch" or "fishing".

4.3.4

element is used as an extension mechanism, or sends a command to the client from the server, or send a command from one client to another. Each time you use this element, you must indicate the related XML namespace. Single messages can contain multiple sub-elements instances. The following known namespaces can be used by the sub-element:

l jabber: x: autOUpdate

l jabber: x: delay

l jabber: x: encrypted

l jabber: x: OOB

l jabber: x: roster

These namespaces are more fully described in the Jabber namespace below.

5. element

Information / Query (IQ) Build a fundamental session between two entities in two entities, and allows the entity to return to the XML format request and response. Information / query is the main use of the use of public user information, such as name, email, address, etc. But its flexible design makes any kind of session. Any entity identified by a Jabber ID can be sessions through one IQ with other entities.

5.1. "Type" attribute

The "Type" property is used to determine the information / query is the request or respond. Below is the available value of the "Type" property:

5.1.1

Type = "error"

Indicates that the query failed. The actual error is described in the sub-element of the element.

example:

Forbidden

5.1.2

Type = "get"

Find a message to the information that queries the namespace. If an attribute is not set, the default is included in the query. A type = "get" element consists of a child element, which is usually , but can also be or another existing child element. However, the specified child element must be left to receive the list of spaces for the information provided by the user. A successful result of the result type = "result" element, is element nested in the specified sub-elements (such as or ) that contains the desired information.

example:

5.1.3

. type = "result" means the package is a success response of the query of type = "get" or type = "set". The result of this successful query is a type = "result" element, which is nested in a sub-element containing the information that contains the query (such as , ). A successful query or get the results of the query result is an empty type = "result" element. An unsuccessful return is a type = "error" element. is usually related to the "ID" attribute, set the query.

example:

Vcard Data Goes Here

5.1.4

Type = "set"

Indicates that the package is to set the value or change the existing data value. A type = "set" element always contains a specified child element, usually , or it can be or other sub-elements that can be accepted. A setup command query successfully returned to an empty type = "result" element.

example:

Vcard Data Goes Here

5.2. Other properties

In addition to the "Type" attribute, IQ elements can also be modified by the following properties.

5.2.1

"From" attribute

Represents the sender of the IQ package. From the XML point of view, this attribute is necessary. This attribute in the actual application is the server to increase and modify (to prevent certain spoofs), so the client's developer does not need to pay too much attention. Attributes.

example:

5.2.2

"Id" attribute

An IQ package is only a unique identifier. The JABBER client or customer library generates "ID" attributes, the client identifies the package to complete the tracking of the package (such as: a type = "result" corresponds to a type = "get" Or Type = "SET"). The "ID" attribute is optional and cannot be used elsewhere.

example:

5.2.3

"To" attribute

Referring to the receiver of the IQ package. In the Jabber client, the format of the Jabber ID corresponding to the "To" property is user @ host / resource. User @ host is also possible, if the user is online, user @ Host will be replaced with user @ host / resource, if the user is not online, user @ Host will directly point to a offline module (for similar server-side gateways, non-user entities The situation is different because they do not have resources and just simply identify a "Server" port of the Jabber ID .jud.jabber.org - Jabber User Directory is such an example). If the package is not property, the server will process the package. example:

5.3 child elements

The child elements of the element are described below.

5.3.1

.

This property will be used when the attribute type of IQ is set to "Error". The error code is defined according to a "type" property containing the error number, and Member includes the wrong text description. For example, the following is a bad request:

. In this way, the server will receive the same entity for the original password when the client is received.

5.3.3

sub-elements in the element define the type of query executed. In special cases, the query can have a special namespace, which is a sub-element defined by the "XMLns" attribute. There is only one child element in the element.

The following example is the XML that will appear when I log in to the server through the Grabber client on my Linux machine.

Stpeter

gabber

F1881517E9917BB815FED 112D81D32B4E4B3AED

As you can see, the authentication query sends authentication information to the server through the client authentication namespace (Jabber: IQ: Auth). Generally, the Jabber core protocol retains Jabber: IQ: * Such a name space. Developers can expand the Jabber core by adding Jabber: IQ: * namespace. These will be more complete in the namespace below.

An empty child element can be sent with the element, which can be retrieved with a Jabber entity related to the namespace specified in the child element. For example, find a client's floral name ("contact list"), the following XML can be sent:

6. Name Space

Currently a standard name space in Jabber:

l Jabber: IQ: Agent - Agent Tool

l Jabber: IQ: Agents - Valid agent group

l Jabber: IQ: Auth - Simple User Certification

l Jabber: IQ: Autoupdate - version update application

l Jabber: IQ: Browse - Jabber Browse

l Jabber: IQ: Conference - General Conference

l Jabber: IQ: Gateway - User Address Gateway

l jabber: iq: last - last time

l Jabber: IQ: OOB - Binding data output

l Jabber: IQ: Private - Private Data Storage

l jabber: iq: register - registration request

l Jabber: IQ: roster - the flower name (contact list) management

l Jabber: IQ: Search - User Database Query

l Jabber: IQ: Time - Client time

l Jabber: IQ: Version - Client Version

l jabber: x: autOUpdate - version notification application

l Jabber: x: Conference - Conference invitation

l jabber: x: delay - the object displayed

l Jabber: x: Encrypted - encrypted message

l jabber: x: envelope - Message envelope

l jabber: x: Event - Message event

l jabber: x: eXpire - message termination

l jabber: x: OOB - Binding data (file transfer) output

l jabber: x: roster - internal flown booklet

l jabber: x: Signed - Mark online status

l vcard-temp - temporary VCARD

Details of these namespaces will be described in detail below.

6.1. Jabber: IQ: Agent - Agent Tool

The agent tool namespace contains all the tools for a proxy. Jabber: IQ: Angents query is usually used to register a specified service, agent, and transmitter.

It may also verify all tool details for specified agents. For example, a client can determine if an open registration can be done.

example:

AIM Transport this is the aid transport

AIM / AOL ScreenName

AIM

6.2. Jabber: IQ: Angents - list of agents available

The available proxy list namespace contains a set of entities, which have some special tools and can serve another entity. In most cases, the list of available proxy is used to display a list of available transmitters on a server.

Note: This name space is against the supporters of Jabber: IQ: Browse (??).

example:

User Directory

You May Register and Create a Public Searchable

Profile, And Search for other register Jabber

Users.

Jud

AIM Transport

this is the aid transport

AIM / AOL ScreenName

AIM

6.3. Jabber: IQ: Auth - Simple client authentication

Simple customer authentication namespace is a simple mechanism for authenticating clients, which creates a resource for the connection between the client to the server.

The authentication successfully returns a type = "result" IQ response. In order to be successful, an error IQ element is returned.

If the namespace or password is not sent, if the server allows, the server will create an anonymous resource.

example:

juliet

Secret

BalCony

juliet

a5e

052C

48C

455BF21D937CCF17225916D9486B09

BalCony

juliet

secret

BalCony

6.4. Jabber: IQ: AutoupDate - Release Update Application

Version Update Application Name Space Allows the client to apply for requests to all available software updates.

example:

6.5. Jabber: IQ: Browse - Jabber Browse

Jabber browsing the role of the namespace is that one is a way to increase the structure of the Jabber IDs in the Jabber world, one is to discover the services or applications provided for different Jabber entities. The basic concept of a Jabber browse is a JID-TYPE (a concept of a simulation type of file). Here is the highest level of Jid-Types in imagination, but some other logic will be added over time:

l application

l conference

l title

l Keywords

l

l service

l user

Each of the above categories has a sub-class list, such as user / client, or user / device ("client" or "device" just a "resource" concept), conference / IRC, service / ICQ, title / inventory . Generally, by using Jabber: IQ: Browse Space You will have an element corresponding to a JID-Type category above, which typically has a "type" property of the specified subtype.

Jabber: IQ: Browse is an agent or other service corresponding to the server instead of Jabber: IQ: Agents namespace. Below is an example of browsing the server:

JABBER client sends:

JABBER server returns:

TYPE = "jabber"

JID = "jabber.org" XMLns = "Jabber: IQ: Browse>

TYPE = "JUD"

JID = "users.jabber.org"

Name = "Jabber User Directory">

jabber: iq: register

jabber: IQ: search

TYPE = "AIM"

JID = "aim.jabber.org"

Name = "AIM TRANSPORT">

jabber: iq: register

jabber: IQ: search

TYPE = "private"

JID = "conference.jabber.org"

Name = "Private Chatrooms">

An example in the meeting:

6.6. Jabber: IQ: Conference - General Conference

The general meeting namespace provides a mechanism for a conference room (such as a group chat room) and provides the entrance of the meeting room. This name space is used to use the element to obtain information about a meeting room, including request information requiring to join this meeting room, and setting information for this meeting room (usually to join this room). The request to enter the room will be similar to:

1. Want to join the room submit a request for Type = "get". This XML will be the following form:

2. Accept the IQ response from the type = "result" from the room to be added, where there is a parameter required to enter the room. This XML will be the following form:

room name

The child elements of all the request elements here are optional. Nickname element indicates that you need a nickname in your room. The key (Secret) element indicates that the user entering the room needs to provide a password. Single (privacy) element indicates that if the user provides such an element in a type = "SET" IQ package, the conference server hides the user's true Jabbere ID. The name (Name) element is the name of the room (with Jabber: IQ: Browse, you can see the same room name).

3. Send the room to the current state to join. XML is as follows:

4. If you want to join the room submit a Type = "SET" IQ package and enters the required information. XML is as follows:

Mynick

Mysecondnick

THESECRET

Note that when the user's first selection is accepted, the user can submit multiple nicknames. If the user does not provide a nickname, the server assigns a nickname to the user.

5. Receive the notification of the room you join, this IQ is returned in the format:

Room @ Server / UniqueidNumber

Mynick

This unique ID number is a hash of the user's Jabber ID.

6.7. Jabber: IQ: Gateway - User Address Gateway

Usually communications with non-Jabber network users, each non-Jabber network may have unique user addresses, and this address may not be unified. The user address gateway is to solve this problem, which gives the Jabber client to make the correct Jabber IDs when sending a subscription to non-Jabber network users. These by prompting and sessions for users, booting the information required to create a correct Jabber ID to be implemented. This ordinary interaction will be demonstrated below:

1. The client is sent to the gateway with Jabber: IQ: Get: Get:

2. The server returns an iQ containing the request approval and its description text.

Please enter the aol screen name of the person

You 10 Like to Contact.

Screen Name

3. The client sends an IQ SET containing the specified information to the gateway:

Joe Cool

4. The server returns an iQ result containing the correct Jabber ID

joecool@aim.jabber.org

6.8. Jabber: IQ: Last - last online time

The last online time name space provides a standard method, and one or more service updates of a Jabber entity can be queried by this method, or a customer last connection (or activity) to a server. The value returned every time is a second number. The entity for query can explain the information obtained by the following method:

l User @ Server / Resource - the time for the last event of the user

l User @ server - the time for the last connection of the user

l Server - the last time that the server is started

Example (server):

Example (client):

Disconnected

6.9. Jabber: IQ: OOB - Binding data output

Binding Data Output Name Space Provides a standard method for client-client file transfer, and implements a special namespace through the server's transmission / proxy transmitter:

example:

http://denmark.com/act4/letter-1.html

There's a letter for you sir.

6.10. Jabber: IQ: Private - Private Data Storage

Private data storage namespace is a mechanism for storing private data on the Jabber server. The stored data can be any legal XML data. The current status information stored at the server is the typical usage of this name space.

Example 1 (Client storage private data):

Hamlet

Example 2 (Client Restable Private Data):

In addition, for private data storage, the 1.4 version server supports all valid namespaces on the server (with the namespace starting with "Jabber", the XML data for calling the Jabber system). This data exists in the roster of the user of the IQ package of type = "set" to the server side.

Example 1 (Client Save Public Data):

Thai

Blue

Bach

Example 2 (Client Retrieving Public Data):

6.11. Jabber: IQ: register - Registration Request

Registration Request Name Space Register one or more services. It is also used to update or delete a registration.

example:

Some Instructions to Be Displayed WHEN THE

User is Filling Out The Form.

6.12. Jabber: IQ: Roster - Contact List Management

The contact list management name space is the client to manage their flown books, which is saved on the server so that users can get it anywhere. The flower name is a list of commands for all subscription information on this account, including user nicknames and contact lists. When the user logs in from any resource, the server will send the roster to the user.

The flower name is a list of entries. Each entry element has the properties describing it. Each entry element contains group elements it belongs. Here is the properties of the element:

l "jid" is an entry Jabber ID

l "subscription" all the current state of the user corresponding to the subscription related to this entry. It can be "none", "to" (with a subscription sent to this entry), "From" (send a subscription from this entry), "Both" (to, from), or " Remove "(delete an entry from the flower roster).

l "ask" is the current state of a request for this entry. Subscribe indicates that the request is subscribed to the entry, and its value is that unsubscribe means cancels the subscription.

l "name" means nickname

By using a , a Jabber client can control the user's JabberID, name property, group elements, and can create or delete contacts on the contact list. The server manages all other properties based on the response of the current status subscription request based on the client.

Subscribe example:

Name = "romeo"

Subscription = "none"

ask = "Subscribe">

friends

When a flown and album is changed on the server, the server will push this change to a user. This push is an ordinary package sent from the server to the client. Below is an example:

In the above example, the server is pushing to a roster of the client, indicating that the user has subscribe to the current status information of Romeo@montague.net. Any time of a roster push may occur at any time, the connection is another connection to modify the resource or server (modify the subscription attribute). The client only uses a roster to send to change the display of the flower roster. But not every speech push is both a role.

6.13. Jabber: IQ: Search - User Database Query

Any agent can be a query agent. For example, Jud query Jabber users, ICQ transmitters query ICQ users.

The user sends a GET request to perform the query domain:

TYPE = "get"

ID = "1001"

TO = "users.jabber.org"

From = "romeo@montague.net/orchard">

The query agent returns a critical area:

Fill in a field to search for any

Matching Jabber User

067941FD

96A

6A

2752A

21ABCB6D737130DD51DD50

Note that these domains are returned in the form of a prompt. The security of the transmission also contains a key (see below). The user can now perform standard queries within the allowed domain. The user sends a set request to the agent actual query:

TYPE = "set"

ID = "1002"

TO = "users.jabber.org"

From = "romeo@montague.net/orchard">

capulet

11b830e

604215C

3A

2A

24652C

69fd4efa

2A

7A

5746

The server returns the result according to the query:

juliet capulet

juliet

capulet

julic

The returned style sent is a tool for the query agent. such as:

juliet@capulet.com

julic

juliet

Capulet

Multiple queries results are pushed through the server. When all data is sent, the server will send the following return results:

The client receives multiple "sets", each record, and finally receive "return" indicating "data end". In each tag, the JID attribute is forced to bring.

example:

TYPE = "get"

ID = "1001"

TO = "users.jabber.org"

From = "juliet@capulet.com">

6.14. Jabber: IQ: Time - Client Time

The client time name space is a standard method for changing the current time.

example:

20010214T18: 55: 06

2/15/00

4:55:06 PM

6.15. Jabber: IQ: Version - Client Version

The client version name space is a standard method for obtaining the version information of another user's client.

example:

gabber

0.8.1

(Powered by: jabberoo 1.0.0

Linux

2.2.16

-22 I686

6.16. Jabber: x: AutoupDate - application version notification

Version Change Application Name Space Make the server to notify the client when available in a new version of an app.

example:

a new version of winjab

Is Available, see http://winjab.sourceforge.net/

6.17. Jabber: x: Conference - Conference invitation

The meeting invitation name space allows users to invite other Jabber users to the specified meeting room. Related Information - The Jabber ID of the meeting room, embedded in elements of a message.

example:

Wherefore Art THOU Romeo?

example:

and there a. Where is my romeo?

god

6.21. Jabber: x: Event - Message Event

The message time namespace is a mechanism that identifies the status of a message. Now, the event is associated with a message: l - a user is replying to the message

L - Messages sent to the specified recipient

l - Show messages to the specified recipient

l - Messages for departing offline

For the client, support for these message events is optional, and these message events are sent only if another user issues a request in the chat. Different JABBER clients will display different current status messages.

Example of a request for message notification:

From = "juliet@capulet.com/balcony"

TO = "romeo@montague.net/orchard"

ID = "1001">

by Whose Direction Found'St THOU OUT this place?

Send a message notification:

by Whose Direction Found'St THOU OUT this place?

1001

Multiple message events can be requested at the same time.

6.22. Jabber: x: eXpire - Message expiration

Message expiration namespace is a simple extension of a limited survival event. If the message is stored offline, the server will no longer send the message. If a message is sent for a preview, the Jabber client can choose not to display the message. "Secondes" property defines the event sent by the message.

example:

There's a letter for you sir

6.23. Jabber: x: OOB - Binding data output

The binding data output namespace enables the user to realize the performance of file transfer by switching a standard URL. Urls exchange using Jabber: x: OOB can include any message (within a sub-element), feel like an attachment in Email. Multiple accessories can be included in the same message.

example:

url attached.

http://denmark.com/act4/letter-1.html

there's a letter for you sir

6.24. Jabber: x: roster - Built-in flower name booklet

The built-in flower name book enables the user to include the flown book entry in a message, which is easy to send a contact between the user. Each flower name album is included in a sub-element of . This element is usually used in a element, but this is not necessary.

example:

Here Are Some New Jabber Uses

To Add to your contact list!

royalty

friends

6.25. Jabber: x: Signed - current status with symbols

The current status name space with symbols is used to support exchange using a public key (the client uses the PGP or GPG, and the server is encrypted using the same namespaces) encrypted current status information. A related name space, Jabber: x: Encrypted is used to support encrypted messages.

example:

Away

be back later

ID8DBQA6KASV0XPC2 / Pofpkranz0aj9ueyywwwsreddikk3aymftftqqdjwcfbcld

JCSuor0fls Rdfjapasmgsm Inanm

6.26. VCard-Temp - Temporary VCARD

The VCARD format is an "e-commerce card standard format," by using direct exchange of personal data over the Internet, as in the environment under the non-internet ". Since the format of XML's VCARD has not been standardized, the Jabber.org project is temporarily set up for such a temporary name file before the XML's VCARD standard is established. Since there is no progress in the designation of the official standard of Vcard in these years, Jabber.org developers have created a project to attract other developers outside the JABBER community. Therefore, the last DTD of the last XML VCARD format may be found in the URL below: http://www.vcard-xml.org/

Example 1 (client request to vcard):

Example 2 (The client receives VCARD data):

Vcard Data Goes Here

Example 3 (Send VCARD to the server):

Vcard Data Goes Here

7. Use example

This section provides some different views on the Jabber protocol, and is expounded in use. Each of the following examples show a Jabber user to complete a full task message flow, which includes receiving and transmitting, such as registering a server, login, changing the current state, or sending a message. If time allows, I will take this part more.

7.1. Jabber user registration

This use case is the evil display Jabber user opens a socket connection to the server, as well as the server's response (such as: tag).

1. Jabber users apply for a Socket connection on the server by turning on an XML stream from the client to the server.

Send:

To = 'capulet.com'

XMLns = 'Jabber: Client'

XMLns: stream = 'http: //etherx.jabber.org/streams'>

2. The server responds by turning on an XML stream from the server to the client.

Recv:

From = 'capulet.com'

ID = '

180763465 '

XMLns = 'Jabber: Client'

XMLns: stream = 'http: //etherx.jabber.org/streams'>

3. Jabber users provide a registration account (in theory, this requires a different order: first ask the server what information you need, and then the server know what kind of information needed; but in practice, it is assumed to be required. : User name, resource, password) information.

Send:

TYPE = 'set'>

juliet

BalCony

4. The server responds to an empty type "result" IQ element, indicating that the registration has been successful.

Recv:

TYPE = 'result' />

7.2. Jabber user landing

1. Jabber users ask the server to log in to the information provided.

Send:

TYPE = 'get'>

juliet

2. The server prompts the Jabber user to log in to the information.

Recv:

TYPE = 'RESULT'>

juliet

500

3b905bfd

3. Jabber users provide the information you need - in this case, it is a element that is a hash of the zero knowledge authentication for information. (For details, please see http://docs.jabber.org/draft-proto/html/zerok.html).

Send:

TYPE = 'set'>

juliet

BalCony

77d7eacde5e56b9622d

0A

075cb88361b

110F

B9D7

4. The server responds to an empty type "result" IQ element, indicating that the landing is successful.

Recv:

TYPE = 'result' />

5. Jabber user sends the current state to the server and indicates its online.

Send:

online

7.3. Jabber users add a contact

1. The Jabber client adds a contact (just the preparatory operation) on the roster.

Send:

Name = 'Remeo' />

2. Jabber users send a subscription request for that contact.

Send: WhereFore Are THOU?

3. The server sends a flower list to the user a new entry and a type "None" subscription (already already available).

Recv:

Name = 'romeo'

Subscription = 'none' />

4. The server sends a type "Result" IQ package that means that the flower name is successful (it is a bit doubtful, this package is sent from Jabber users to Jabber users!)

RECV:

From='juliet@capulet.com/balcony '

To='julie@capulet.com/balcony '

TYPE = 'RESULT'>

5. The server sends another flower list to push, this time is the ask = 'subscribe' attribute, indicating the status of the subscription being undetermined.

Recv:

ask = 'Subscribe'

Jid='Romeo@montague.net '

Name = 'romeo'

Subscription = 'none' />

6. What will Romeo will the next response to the subscription request? Now we assume that the subscription is "end" with Romeo accepting subscription requests.

RECV:

From='romeo@montague.net '

To='juliet@capulet.com '

Type = 'subscribed' />

7. The server will send a flower list again to the client, this time subscription = 'to', indicating that the subscription request is accepted (Juliet can now subscribe to the current state of Romeo).

Recv:

Jid='Romeo@montague.net '

Name = 'romeo'

Subscription = 'to' />

7.4. Jabber user gets the roster

Send:

Recv:

Jid='Romeo@montague.net '

Name = 'romeo'

Subscription = 'Both' />

7.5. Jabber user sends a message

Send:

wherefore is there?

Note: The server adds a source address based on the session information of the Jabber user, so that the recipient has included the source address.

7.6. Jabber users change the current state

Send:

stepped away ...

Away

7.7. Jabber user logs out

It is easy to log out, just need to close ...

Send:

Recv:

8. References

This Agreement refers to the following documents

l Jabber Development Guide (http://docs.jabber.org/jpg/)

l Jabber Agreement - Standard (http://docs.jabber.org/proto/)

l Jabber protocol - draft (http://docs.jabber.org/draft-proto/)

l Romeo and juliet

(http://tech-two.mit.edu/shakespeare/tragedy/romoistjuliet/full.html)

9. Conclusion

This document provides a detailed count of XML protocols about Jabber. If you have any questions about this document, please contact the author by email or jabber, check with the author (Peter Saint-Andre), Stpeter@jabber.org when his account.

10. Copyright information

This Document is Copyright 2001 by Peter Saint-Andre.

PERMISSION IS granted to copy, distribute and / or modify this document under the Terms of the gnu free documentation license (http://www.gnu.org/copyleft/fdl.html),

Version 1.1 or Any Later Version Published by The Free Software Foundation, with no

Invariant Sections, No Front-Cover Texts, And no Back-cover Texts. You. Obtain A

Copy of the gnu free documentation license from the free software findation by

Visiting http://www.fsf.org/ or by Writing TO:

The Free Software Foundation, Inc.

59 TEMPLE PLACE

-

Suite

330

Boston

,

MA

02111-1307

USA

Appendix A Standard Error Code

Below is some of the brief description of the error code in Jabber. The Jabber server generates these error codes under different error conditions. General Jabber error code is based on the RFC 2616 (http://www.ietf.org/rfc/rfc2616.txt) of HTTP specifications. However, Jabber does not use all HTTP error code, and the Jabber error code corresponds to the HTTP error code, usually only Jabber's own meaning. Note This appendix only includes the error code generated by the Jabber server, and does not include server-side components such as gateways to the external message system.

Error Code Description Note 302 Redirect Although the HTTP specifier contains eight different code to indicate redirection, Jabber uses only one (used to replace all redirect errors). However, Jabber code 302 is reserved for future features, and there is currently no 400 bad request Jabber code 400 to inform the Jabber client, a request that requests cannot be identified because of its bad syntax. For example, when a Jabber client sends a subscription request to itself to send a message that does not contain the "to" attribute, the Jabber code 400 will generate. 401 Unauthorized Jabber Code 401 is used to notify the Jabber client that they provide errors, such as using an error password, or unknown username while landing a Jabber server. 402 The cost of the Jabber code 402 is reserved for future use, and it is not available. 403 Prohibiting Jabber Code 403 is used by the Jabber server to notify the Jabber client's request to identify, but the server refuses to execute. Currently only used password storage in the registration process failed. 404 Did not find the Jabber code 404 to indicate that the Jabber server does not find any content that matches the Jabberid, which is a Destination of a Jabber client sends a message. For example, a user intends to send a message to a non-existing JabberID. If the recipient's Jabber server cannot arrive, an error code from the 500th level will be sent. 405 The Jabber Code 405 that is not allowed is used in Jabberid that is not allowed to be identified by the 'from' address. For example, it may be generated, a non-administrator user attempts to send an administrator level message on the server, or a user attempts to send a Jabber server time or version, or send a different Jabberid VCARD. 406 Unacceptable Jabber Code 406 is used for the server because some reasons do not accept a package. For example, this may happen, a Jabber client tries to use Jabber: IQ: Private to store information on the server, but the current name space is started with "Jabber:" in Jabber: The beginning of the XML in Jabber ). Another possibility that 406 errors is that when a Jabber client tries to register with an empty password to a Jabber server. 407 Must registration Jabber code 407 The Jabber server generates Jabber Code 408 when a Jabber client cannot initiate a request during the server ready for the server. This code is currently only used in zero authentication mode used by the Jabber Session Manager. 409 Conflict Slightly 500 Server Internal Error When a Jabber server encounters an expected condition, the condition blocks the server from processing a package from the Jabber client, which is the Jabber code 500. Now, the only time that will trigger 500 error code is when a Jabber client tries to authenticate through server, and the authentication is not processed because some reasons are not processed (if you can't save your password). 501 Unauthorized When the server does not support the function of the Jabber client request, use the jabber code 501. For example, the code only when the Jabber client sends an authentication request, and the server sends a Jabber code 501 when the authentication request does not include any authentication method defined in the server configuration. This code is also used, when a Jabber client tries to register a server that is not allowed to register. 502 Remote Server Error When the forwarding a package fails because it cannot reach the remote server, use the Jabber code 502. The special example of this code includes a failure of a remote server, which cannot obtain the host name of the remote server, and the external time expired by the remote server error.

转载请注明原文地址:https://www.9cbs.com/read-18860.html

New Post(0)