Server-to-server communications
XEP-0288 describes server-to-server connections (S2S), which allows servers to send messages to each other on the same TCP network using bidirectional communication, as opposed to requiring TCP connections between the servers. This allows servers to be connected together and share information seamlessly, and it facilitates the creation of a federated network of servers in which servers can pass along messages to other servers, and clients connected to each server can communicate with clients throughout the entire network. One of the benefits of this behavior is that each server can be set up with its own configuration, modules, components, and users, while also taking advantage of other servers, which have their own configuration.
Prosody supports S2S connections without any work on your part. Let's get started with an example, then we'll work on adding security to this example. First, each server that you wish to connect will need the following lines in prosody...