XEP-xxxx: Jingle HTTP

This document describes how to negotiate HTTP over Jingle. It allows an XMPP client behind a NAT to provide an HTTP server to other clients in the XMPP network.


WARNING: This Standards-Track document is Experimental. Publication as an XMPP Extension Protocol does not imply approval of this proposal by the XMPP Standards Foundation. Implementation of the protocol described herein is encouraged in exploratory implementations, but production systems should not deploy implementations of this protocol until it advances to a status of Draft.


Document Information

Series: XEP
Number: xxxx
Publisher: XMPP Standards Foundation
Status: Experimental
Type: Standards Track
Version: 0.0.1
Last Updated: 2008-10-23
Approving Body: XMPP Council
Dependencies: XMPP Core, XEP-0166
Supersedes: None
Superseded By: None
Short Name: NOT_YET_ASSIGNED
Wiki Page: <http://wiki.jabber.org/index.php/Jingle HTTP (XEP-xxxx)>


Author Information

Dirk Meyer

Email: dmeyer@tzi.de
JabberID: dmeyer@jabber.org


Legal Notices

Copyright

This XMPP Extension Protocol is copyright (c) 1999 - 2008 by the XMPP Standards Foundation (XSF).

Permissions

Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.

Disclaimer of Warranty

## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. In no event shall the XMPP Standards Foundation or the authors of this Specification be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification. ##

Limitation of Liability

In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising out of the use or inability to use the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.

IPR Conformance

This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which may be found at <http://www.xmpp.org/extensions/ipr-policy.shtml> or obtained by writing to XSF, P.O. Box 1641, Denver, CO 80201 USA).

Discussion Venue

The preferred venue for discussion of this document is the Standards discussion list: <http://mail.jabber.org/mailman/listinfo/standards>.

Errata may be sent to <editor@xmpp.org>.

Relation to XMPP

The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 3920) and XMPP IM (RFC 3921) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.

Conformance Terms

The following keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".


Table of Contents


1. Introduction
2. How It Works
3. Implementation Notes
4. Security Considerations
5. IANA Considerations
6. XMPP Registrar Considerations
7. XML Schema
Notes
Revision History


1. Introduction

XMPP provides an extensible core for many different use cases. Nevertheless, an XMPP bot may want to provide hypertext information to a peer. Possible scenarios are a small personal information page of the user, a directory with file downloads to choose from or a small web application. It is possible to cover all these use cases in XMPP extensions but it may be a much simpler approach to re-use existing standards like HTTP, HTML, CSS, and JavaScript. Besides XMPP a client could also include a small HTTP server for these kinds of use cases. Unfortunately user clients are often behind a NAT. Solutions like NAT-PMP are the preferred way to solve this problem but sometimes this is not possible. Instead the nodes need a TURN server or something similar for the HTTP client to connect to the HTTP server.

These connection helpers needs additional negotiation. In the XMPP world "something similar" could be a In-Band Bytestreams [1] or SOCKS5 Bytestreams [2], or a future ice-tcp Jingle transport based on TCP Candidates with Interactive Connectivity Establishment (ICE) [3]. Jingle [4] defines a generic way in XMPP to open such a bytestream.

2. How It Works

The node providing the internal web server must announce the service discovery feature 'urn:xmpp:tmp:jingle:apps:http' according to Service Discovery [5]. Since HTTP is a client/server request/response mechanism the node in the role of the HTTP client does not need to announce support and MUST NOT announce 'urn:xmpp:tmp:jingle:apps:http' unless it integrates an HTTP server as well.

A web browser uses an http:// or https:// URI to determine that the given resource can be accessed using HTTP. An HTTP URL may include the hostname and port of the HTTP server, but HTTP over Jingle does not provide a valid host name and therefor a resource can not be addressed globally. Links in hypertext documents on the same host can not contain a host name, websites on other hosts can not link to a resource on a Jingle HTTP server. If the client supplies a 'Host:' header field it MUST be ignored.

The HTTP client sends a Jingle session-initiation request to the HTTP server node. The content-type of the request specifies two things:

  1. An application type of "urn:xmpp:tmp:jingle:apps:http" (see Protocol Namespaces regarding issuance of one or more permanent namespaces)

  2. Options for the reliable transport method, such as In-Band Bytestreams ("IBB") as defined in XEP-0047 or SOCKS5 Bytestreams ("S5B") as defined in XEP-0065.

In this example <romeo@montague.com> wants to access the index.html document from <juliet@capulet.com/balcony> and the initiation request specifies Romeos's desired stream parameters along with a transport method of "bytestreams" (i.e., XEP-0065).

The flow is as follows.

 Romeo                        Juliet
   |                             |
   |   session-initiate          |
   |---------------------------->|
   |   ack                       |
   |<----------------------------|
   |   [ SOCKS5 negotiation ]    |
   |<--------------------------->|
   |   session-accept            |
   |<----------------------------|
   |   ack                       |
   |---------------------------->|
   |   GET /index.html HTTP/1.1  |
   |---------------------------->|
   |   [ index.html ]            |
   |<----------------------------|
   |   terminate                 |
   |---------------------------->|
   |   ack                       |
   |<----------------------------|
   |                             |
  

This flow includes much more round-trips than the "normal" HTTP over TCP. In many cases the HTTP client wants to receive more than one file; the index.html files may contain links to images or a CSS file. To avoid setting up a Jingle session for every document both HTTP client and server SHOULD support HTTP 1.1, particularly the keep-alive option. This makes it possible to use one Jingle HTTP session for several HTTP requests.

3. Implementation Notes

Implementation notes with some help how to use existing HTML render engines with xhttp will be provided in a later version of this document.

4. Security Considerations

Security considerations will be provided in a later version of this document.

5. IANA Considerations

This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [6].

6. XMPP Registrar Considerations

XMPP Registrar considerations will be provided in a later version of this document.

7. XML Schema

The XML schema will be provided in a later version of this document.


Notes

1. XEP-0047: In-Band Bytestreams <http://www.xmpp.org/extensions/xep-0047.html>.

2. XEP-0065: SOCKS5 Bytestreams <http://www.xmpp.org/extensions/xep-0065.html>.

3. TCP Candidates with Interactive Connectivity Establishment (ICE) <http://tools.ietf.org/html/draft-ietf-mmusic-ice-tcp>. Work in progress.

4. XEP-0166: Jingle <http://www.xmpp.org/extensions/xep-0166.html>.

5. XEP-0030: Service Discovery <http://www.xmpp.org/extensions/xep-0030.html>.

6. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <http://www.iana.org/>.


Revision History

Version 0.0.1 (2008-10-23)

First draft.

(dm)

END