module XMPP::ConnectionResolver

Overview

Resolves how and where a client should connect, combining explicit configuration with optional XEP-0368 SRV discovery.

Defined in:

xmpp/connection.cr

Class Method Summary

Class Method Detail

def self.resolve(config : Config) : Array(ResolvedEndpoint) #

Returns the ordered list of endpoints to try.

When the caller pinned an explicit host, or direct-TLS discovery is not requested, the sole endpoint is the configured host/port in STARTTLS mode (the original behavior).

When prefer_direct_tls is enabled and no host was pinned, both _xmpps-client and _xmpp-client SRV records are looked up and merged per XEP-0368 ยง3, preferring direct-TLS targets first. If discovery returns nothing, the client falls back to the configured host/port with STARTTLS (matching a "." target or absent records).


[View source]