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.
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)>
Email:
dmeyer@tzi.de
JabberID:
dmeyer@jabber.org
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>.
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.
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".
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
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.
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:
An application type of "urn:xmpp:tmp:jingle:apps:http" (see Protocol Namespaces regarding issuance of one or more permanent namespaces)
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.
Implementation notes with some help how to use existing HTML render engines with xhttp will be provided in a later version of this document.
Security considerations will be provided in a later version of this document.
This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [6].
XMPP Registrar considerations will be provided in a later version of this document.
The XML schema will be provided in a later version of this document.
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/>.
First draft.
(dm)END