even more clarification
This commit is contained in:
parent
78d8118846
commit
d493c82e82
1 changed files with 24 additions and 20 deletions
|
@ -71,36 +71,40 @@ This version of the specification is generated from
|
||||||
`matrix-doc <https://github.com/matrix-org/matrix-doc>`_ as of Git commit
|
`matrix-doc <https://github.com/matrix-org/matrix-doc>`_ as of Git commit
|
||||||
`{{git_version}} <https://github.com/matrix-org/matrix-doc/tree/{{git_rev}}>`_.
|
`{{git_version}} <https://github.com/matrix-org/matrix-doc/tree/{{git_rev}}>`_.
|
||||||
|
|
||||||
Server Discovery
|
Server discovery
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
Resolving Server Names
|
Resolving server names
|
||||||
~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Each matrix homeserver is identified by a server name consisting of a hostname
|
Each matrix homeserver is identified by a server name consisting of a hostname
|
||||||
and an optional port, as described by the `grammar <../appendices.html#server-name>`_.
|
and an optional port, as described by the `grammar
|
||||||
|
<../appendices.html#server-name>`_. Server names should be resolved to an IP
|
||||||
|
address and port using the following process:
|
||||||
|
|
||||||
If the hostname is an IP literal, then that IP address should be used, together
|
* If the hostname is an IP literal, then that IP address should be used,
|
||||||
with the given port number, or 8448 if no port is given.
|
together with the given port number, or 8448 if no port is given.
|
||||||
|
|
||||||
Otherwise, if the port is present, then an IP address is discovered by looking
|
* Otherwise, if the port is present, then an IP address is discovered by
|
||||||
up an AAAA or A record for the hostname, and the specified port is used.
|
looking up an AAAA or A record for the hostname, and the specified port is
|
||||||
|
used.
|
||||||
|
|
||||||
If the hostname is not an IP literal and no port is given, the server is
|
* If the hostname is not an IP literal and no port is given, the server is
|
||||||
discovered by first looking up a ``_matrix._tcp`` SRV record for the hostname,
|
discovered by first looking up a ``_matrix._tcp`` SRV record for the
|
||||||
which may give a hostname (to be looked up using AAAA or A queries) and port.
|
hostname, which may give a hostname (to be looked up using AAAA or A queries)
|
||||||
If the SRV record does not exist, then the server is discovered by looking up
|
and port. If the SRV record does not exist, then the server is discovered by
|
||||||
an AAAA or A record on the hostname and taking the default fallback port number
|
looking up an AAAA or A record on the hostname and taking the default
|
||||||
of 8448.
|
fallback port number of 8448.
|
||||||
|
|
||||||
Homeservers may use SRV records to load balance requests between multiple TLS
|
Homeservers may use SRV records to load balance requests between multiple TLS
|
||||||
endpoints or to failover to another endpoint if an endpoint fails.
|
endpoints or to failover to another endpoint if an endpoint fails.
|
||||||
|
|
||||||
When making requests to servers, use the DNS name of the target server in the
|
When making requests to servers, use the hostname of the target server in the
|
||||||
``Host`` header, regardless of the host given in the SRV record. For example,
|
``Host`` header, regardless of the any hostname given in the SRV record. For
|
||||||
if making a request to ``example.org``, and the SRV record resolves to ``matrix.
|
example, if the server name is ``example.org``, and the SRV record resolves to
|
||||||
example.org``, the ``Host`` header in the request should be ``example.org``. The
|
``matrix.example.org``, the ``Host`` header in the request should be
|
||||||
port number for target server should not appear in the ``Host`` header.
|
``example.org``. The port number for target server should **not** appear in the
|
||||||
|
``Host`` header.
|
||||||
|
|
||||||
Server implementation
|
Server implementation
|
||||||
~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue