%ents; ]>
Discovering Alternative XMPP Connection Methods This document defines an XMPP Extension Protocol for discovering alternative methods of connecting to an XMPP server using two ways: (1) DNS TXT Resource Record format; and (2) Web Host Metadata Link format. &LEGALNOTICE; 0156 Draft Standards Track Standards Council XMPP Core RFC 1464 alt-connections &hildjj; &stpeter; &lance; 1.3.1 2020-07-07 adiaholic

Include all described formats in the abstract, instead of just mentioning the TXT record format.

1.3.0 2020-06-23 fs

Fix reference to RFC 6415 and organize requirements more clearly. This raises the JSON requirement from MAY (OPTIONAL) to SHOULD (effectively), to accustom web-based software.

1.2.0 2019-02-20 wk

Add information about CORS header usage and requirements

1.1.5 2018-09-30 jsc

Make JSON example less error-prone.

1.1.4 2018-09-30 jsc

Fix XML header on example.

1.1.3 2018-07-21 egp

Replace references to draft-ietf-xmpp-websocket with RFC7395 (XMPP over WebSocket).

1.1.2 2016-06-07 XSF Editor: ssw
  • Clarify that the XML version of the XRD document is required by the RFC and the JSON version is optional.
  • Update references to draft-ietf-xmpp-websocket to point to RFC 7395.
1.1.1 2016-06-06 XSF Editor: ssw

Fix a small typo in one of the examples (UTF-9 encoding).

1.1 2014-01-08 ls/psa

Defined HTTP lookup methods using well-known URIs as specified in RFC 5785.

1.0 2007-06-12 psa

Per a vote of the XMPP Council, advanced status to Draft; XMPP Registrar assigned alt-connections shortname and created appropriate registry.

0.7 2007-04-18 psa

Updated to reflect renaming of HTTP Binding to XMPP Over BOSH.

0.6 2007-01-30 psa

Finally and definitively removed _xmpp-client-tcp and _xmpp-server-tcp attributes since clients and servers should use either SRV records or standard XMPP ports (5222 or 5269).

0.5 2007-01-30 psa

Removed _xmpp-client-tcpssl attribute since use of the old-style SSL-only port is discouraged.

0.4 2007-01-29 psa

Added _xmpp-client-tcpssl for old-style SSL connections; added discussion of IETF U-NAPTR technology.

0.3 2006-05-16 psa

Clarified order of lookups; restored _xmpp-client-tcp and added _xmpp-server-tcp as optional records if SRV is not supported or accessible.

0.2 2005-12-05 psa

Removed _xmpp-client-tcp from TXT records (belongs in SRV records only).

0.1 2005-09-08 psa

Initial version.

0.0.3 2005-09-07 psa

More fully specified the rationale for using DNS TXT records.

0.0.2 2005-08-27 psa

Added security considerations and registrar considerations.

0.0.1 2005-08-23 psa/jh

First draft.

Although &xmppcore; specifies the use of TCP as the method of connecting to an XMPP server, alternative connection methods exist, including the &xep0124; method (for which &xep0206; is the XMPP profile) and the websocket subprotocol specified in &rfc7395;. For some of these methods, it is necessary to discover further parameters before connecting, such as the HTTP URL of an alternative connection manager. Without ways to auto-discover alternative connection methods, the relevant information would need to be provided manually by a human user (which is cumbersome and error-prone) or hard-coded into XMPP software applications (which is brittle and not interoperable).

This document defines two ways to encapsulate information about alternative connection methods for auto-discovery:

  1. DNS TXT resource records
  2. Link entries in a server's "host-meta" file

The following format for DNS TXT resource records is specified in RFC 1464:

<"attribute name=attribute value">]]>

This document specifies that the following additional rules apply for DNS TXT resource records used to specify alternative connection methods:

  1. It is RECOMMENDED for the owner to be "_xmppconnect".
  2. The class field SHOULD be IN.
  3. The ttl field is OPTIONAL.
  4. The attribute name SHOULD begin with the string "_xmpp-client-" or "_xmpp-server-" and SHOULD be registered as described in the XMPP Registrar Considerations section of this document.
  5. If the txt-data field contains only an attribute name (i.e., no unquoted "=" character followed by additional characters), the receiving application SHOULD interpret it as indicating the presence of the attribute or feature with no defined value.
  6. If the txt-data field contains an unquoted "=" character, it MUST also contain an attribute value.

The following business rules apply:

  1. TXT lookups MUST be used only as a fallback after the methods specified in RFC 6120 have been exhausted. The point of this rule is to prevent someone from defining a new XEP-0156 connection method like "_xmpp-client-tcp" to override the SRV records defined in the core XMPP specification.
  2. A domain SHOULD NOT present information in DNS TXT records that is available via the DNS SRV records defined in RFC 6120.
  3. The order of DNS TXT records SHOULD NOT be interpreted as significant by the presenting domain or the receiving entity.

The following examples show two DNS TXT resource records: the first indicates support for the XMPP Over BOSH connection method defined in XEP-0124 and XEP-0206 and the second indicates support for XMPP over WebSocket connections defined in RFC 7395;.

The HTTP lookup method uses Web Host Metadata &rfc6415; to categorize and list the URIs of alternative connection methods. It is primarily intended for use by clients in environments where the ability to perform DNS queries is restricted, such as in web browsers.

Each alternative connection method is specified in the host-meta (XRD) file using a distinctive link relation &rfc5988;. This specification defines several extension relation types:

  • urn:xmpp:alt-connections:httppoll
  • urn:xmpp:alt-connections:websocket
  • urn:xmpp:alt-connections:xbosh

The following business rules apply:

  1. Services implementing this XEP MUST offer the information in the Extensible Resource Descriptor (XRD) format and SHOULD additionally provide the JRD format (both formats are specified in &rfc6415;).
  2. HTTP queries for host-meta information MUST be used only as a fallback after the methods specified in RFC 6120 have been exhausted.
  3. A domain SHOULD NOT present information in host-meta link records that is available via the DNS SRV records defined in RFC 6120.
  4. The order of XMPP related link entries in the host-meta file SHOULD NOT be interpreted as significant by the presenting domain or the receiving entity.

The following examples show two host-meta link records: the first indicates support for the XMPP Over BOSH connection method defined in XEP-0124 and XEP-0206 and the second indicates support for the XMPP Over WebSocket connection method defined in &rfc7395;.

... ... ]]>

It is possible to use additionally a JSON-based format for host-meta information. The JSON representation of the host metadata is named JRD and specified in Appendix A of &rfc6415;. The above XRD example would be presented in JRD as:

To make connection discovery work in web clients (including those hosted on a different domain) the host service SHOULD set appropriate CORS headers for Web Host Metadata files. The exact headers and values are out of scope of this document but may include: Access-Control-Allow-Origin, Access-Control-Allow-Methods and Access-Control-Allow-Headers.

Due care has to be exercised in limiting the scope of Access-Control-Allow-Origin response header to Web Host Metadata files only.

Access-Control-Allow-Origin header with a value of * allows JavaScript code running on a different domain to read the content of Web Host Metadata files. Special value * ensures that the request will only succeed if it is invoked without user credentials (e.g. cookies, HTTP authentication).

It is possible that advertisement of alternative connection methods can introduce security vulnerabilities, since a connecting entity (usually a client) might deliberately seek to connect using the method with the weakest security mechanisms (e.g., no channel encryption or relatively weak authentication). Care needs to be taken in determining which alternative connection methods are appropriate to advertise.

Entities that use these connection methods MUST conform to the security considerations of each method, for example by preferring to use 'https' or 'wss' URLs that are protected using Transport Layer Security (TLS).

Because the link relations specified here are extension relation types rather than registered relation types (see Section 4 of RFC 5988), this document requires no interaction with &IANA;.

The ®ISTRAR; shall include 'urn:xmpp:alt-connections' in its registry of protocol namespaces (see &NAMESPACES;).

  • urn:xmpp:alt-connections

The ®ISTRAR; maintains a registry of attributes for use in DNS TXT resource records that advertise alternative XMPP connection methods (see &ALTCONN;).

®PROCESS; the name of the attribute to be used in DNS TXT records a natural-language description of the alternative connection method the syntax of the DNS TXT record attribute value the document in which the alternative connection method is specified ]]>

The registrant can register more than one attribute at a time, each contained in a separate <method/> element.

This document registers the following values.

_xmpp-client-httppoll HTTP Polling connection method The http: or https: URL at which to contact the HTTP Polling connection manager or proxy XEP-0025 _xmpp-client-websocket XMPP Over WebSocket connection method The ws: or wss: URL at which to contact the WebSocket connection manager or proxy RFC 7395 _xmpp-client-xbosh XMPP Over Bosh connection method The http: or https: URL at which to contact the HTTP Binding (BOSH) connection manager or proxy XEP-0206 ]]>