%ents; ]>
Jingle HTTP Transport Method This specification defines two Jingle transport methods for establishing HTTP connections for either uploading or downloading data. &LEGALNOTICE; 0370 Deferred Standards Track Standards Council XMPP Core XEP-0166 NOT_YET_ASSIGNED &lance; 0.2 2017-09-11 XEP Editor (jwi) Defer due to lack of activity. 0.1 2016-01-12 XEP Editor (mam)

Initial published version approved by the XMPP Council.

0.0.2 2016-01-07 ljts

Renamed <uploaded/> to <completed/>, and made it a child of the <transport/> element in transport-info events.

0.0.1 2015-07-30 ljts

First draft.

&xep0166; defines a framework for negotiating and managing out-of-band data sessions over XMPP. In order to provide a flexible framework, the base Jingle specification defines neither data transport methods nor application formats, leaving that up to separate specifications.

The current document defines two transport methods for establishing and managing data exchanges between XMPP entities using the Hyper Text Transfer Protocol (HTTP, see &rfc2616;); one method is for sharing via pulling data from an HTTP URI (http-download), and the other is for sharing via pushing data to an HTTP URI (http-upload).

Historically, &xep0066; has been used to trigger downloading files via HTTP, as well as initiating the use of any other known URI scheme. However, it has several limitations:

As such, this document defines two Jingle mechanisms designed to meet the following requirements:

In accordance with Section 12 of XEP-0166, this document specifies the following information related to both the Jingle http-download and http-upload transport methods:

  1. The transport negotiation process for http-download is defined in the Negotiating HTTP Download section of this document, and the negotation process for http-upload is defined in the Negotiating HTTP Upload section of this document.

  2. The semantics of the &TRANSPORT; element are defined in the Negotiating HTTP Download and Negotiating HTTP Upload sections of this document.

  3. Successful negotiation of both the http-download and http-upload methods results in use of a streaming transport method suitable for use in Jingle application types where packet loss cannot be tolerated (e.g., file transfer).

  4. Multiple components are not supported by http-download or http-upload.

Negotiating HTTP downloads is done by using a &TRANSPORT; element with the 'urn:xmpp:jingle:transports:http:0' namespace, &VNOTE;. This element MAY include <candidate/> elements which represent URIs where data can be downloaded. Each <candidate/> element MUST include a 'uri' attribute, and MAY contain <header/> elements whose 'name' attribute is an HTTP header and whose text content is the HTTP header value.

Bearer 7472327205ffb74d10b11363044d8c24e3ddba12
]]>

Multiple candidates MAY be provided, indicating that there are multiple URIs from which the data can be retrieved (e.g. multiple candidates could be included to list the primary URI of a file along with several known mirrors).

]]>

The generation of candidates is based on the Jingle content senders, and only the parties specified to send data SHOULD provide candidates.

Upon receiving an HTTP download candidate, parties that are to receive data (based on the Jingle content senders) SHOULD use an HTTP GET request to the candidate URI to fetch the data.

Entities MAY initially provide an empty set of candidates if a suitable download URI is not yet known; advertising candidates later is done with transport-info actions.

Content Creator Content Senders Who Sends Download Candidates Who performs HTTP GET
initiator initiator initiator responder
responder responder initiator
both both both
none none none
responder initiator initiator responder
responder responder initiator
both both both
none none none

Negotiating HTTP uploads is done by using a &TRANSPORT; element with the 'urn:xmpp:jingle:transports:http:upload:0' namespace, &VNOTE;. This element MAY include a <candidate/> element which represents a URI where data can be uploaded. The <candidate/> element MUST include a 'uri' attribute, and MAY contain <header/> elements whose 'name' attribute is an HTTP header and whose text content is the HTTP header value.

Bearer 7472327205ffb74d10b11363044d8c24e3ddba12
]]>

The generation of candidates is based on the Jingle content senders, and only the parties specified to receive data SHOULD provide candidates.

Upon receiving an HTTP upload candidate, parties that are to send data (based on the Jingle content senders) SHOULD use an HTTP PUT request to the candidate URI, where the request body is the data to be transferred.

Content Creator Content Senders Who Sends Upload Candidates Who Performs HTTP PUT
initiator initiator responder initiator
responder initiator responder
both both both
none none none
responder initiator responder initiator
responder initiator responder
both both both
none none none

See Upload Complete for signaling that the upload process has been completed.

A common case for using http-upload is to delegate the storage of the uploaded data to an external hosting service, which means that the receiver might not have the direct ability to know when the uploaded data is ready.

As such, when an upload transfer is used, the party uploading content SHOULD signal when the upload has completed by sending a Jingle transport-info event that specifies the content for which uploading has completed, and includes a <transport/> element qualified by the 'urn:xmpp:jingle:transports:http:upload:0' namespace, which in turn contains a <completed /> element.

]]>

Here, Romeo is offering to send a file to Juliet, so he includes a download URI candidate with his session-initiate.

1969-07-21T02:56:15Z This is a test. If this were a real file... text/plain test.txt 6144 552da749930852c69ae5d2141d3766b1 ]]>

Juliet accepts the offer, and then performs an HTTP GET to retrieve the file.

]]>

Here Romeo is requesting Juliet to send a file by sharing a download URI.

552da749930852c69ae5d2141d3766b1 ]]>

Juliet accepts the request, and includes a download URI in her session-accept.

1969-07-21T02:56:15Z text/plain test.txt 6144 552da749930852c69ae5d2141d3766b1 ]]>

Romeo then retrieves the file using an HTTP GET request.

In this case, Romeo is offering a file to Juliet but wishes to upload it to her.

1969-07-21T02:56:15Z This is a test. If this were a real file... text/plain test.txt 6144 552da749930852c69ae5d2141d3766b1 ]]>

Juliet accepts, and provides a candidate with an upload URI that includes an authorization header.

Bearer 7472327205ffb74d10b11363044d8c24e3ddba12
]]>

Romeo now uses an HTTP PUT to upload his file. Once the upload is complete, he informs Juliet so she knows the file is ready for to read.

]]>

Here Romeo asks Juliet to upload a file.

552da749930852c69ae5d2141d3766b1 ]]>

Juliet accepts the session, and begins uploading the file data with an HTTP PUT request.

1969-07-21T02:56:15Z text/plain test.txt 6144 552da749930852c69ae5d2141d3766b1 ]]>

Once the upload is complete, she informs Romeo that she has completed the upload so that he knows he can access the data he requested.

]]>

To advertise its support for the Jingle HTTP Transport Method, when replying to &xep0030; information requests an entity MUST return URNs for any version of this protocol that the entity supports -- e.g., "urn:xmpp:jingle:transports:http:0" for this version &VNOTE;.

]]> ]]>

In order for an application to determine whether an entity supports this protocol, where possible it SHOULD use the dynamic, presence-based profile of service discovery defined in &xep0115;. However, if an application has not received entity capabilities information from an entity, it SHOULD use explicit service discovery instead.

HTTP URI candidates SHOULD use the "https://" URI scheme instead of "http://", and entities MAY refuse to process URIs that are not "https://".

Certain HTTP headers can cause unintended behaviour, such as using the 'Upgrade' header to trigger a conversion to WebSocket (&rfc6455;).

No interaction with &IANA; is required as a result of this document.

This specification defines the following XML namespaces:

  • urn:xmpp:jingle:transports:http:0
  • urn:xmpp:jingle:transports:http:upload:0
  • urn:xmpp:jingle:transports:http:info:0

The ®ISTRAR; includes the foregoing namespace in its registry of protocol namespaces at &NAMESPACES;, as described in Section 4 of &xep0053;.

&NSVER;

The ®ISTRAR; includes "http-download" in its registry of Jingle transport methods at &JINGLETRANSPORTS;. The registry submission is as follows:

http-download A method for negotiating data exchange via HTTP URI retrieval. streaming XEP-XXXX ]]>

The ®ISTRAR; includes "http-upload" in its registry of Jingle transport methods at &JINGLETRANSPORTS;. The registry submission is as follows:

http-upload A method for negotiating data exchange via uploading to HTTP URIs. streaming XEP-XXXX ]]>
]]> ]]>