struct XMPP::Config

Defined in:

xmpp/config.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(jid : String, password : String, host : String, port : Int32 = 5222, lang : String = "en", tls : Bool = true, skip_cert_verify : Bool = false, time_out : Int32 = 15, log_file : IO | Nil = nil, sasl_auth_order : Array(XMPP::AuthMechanism) = SASL_AUTH_ORDER, auto_presence : Bool = true, io_timeout : Int32 = 30, max_stanza_size : Int32 = XMLStreamReader::DEFAULT_MAX_ELEMENT_SIZE, tls_ca_certificates : Nil | String = nil, prefer_direct_tls : Bool = false, transport : XMPP::TransportMode = TransportMode::Tcp, url : Nil | String = nil) #

[View source]

Instance Method Detail

def auto_presence? : Bool #

auto_presence controls whether to automatically send initial presence after connection Set to false if you want to manually control presence (e.g., for invisible login)


[View source]
def connect_timeout : Int32 #

[View source]
def host : String #

[View source]
def host_explicit? : Bool #

True when the caller supplied an explicit host, in which case SRV-based connection discovery is skipped.


[View source]
def io_timeout : Int32 #

[View source]
def jid : String #

[View source]
def lang : String #

[View source]
def log_file : IO | Nil #

[View source]
def max_stanza_size : Int32 #

[View source]
def parsed_jid : JID #

[View source]
def password : String #

[View source]
def port : Int32 #

[View source]
def prefer_direct_tls? : Bool #

prefer_direct_tls opts into XEP-0368 connection discovery: when true and no explicit host is configured, the client looks up _xmpps-client/_xmpp-client SRV records and connects using direct TLS where the server offers it. Defaults to false (STARTTLS on port 5222).


[View source]
def sasl_auth_order : Array(AuthMechanism) #

Ordered SASL mechanisms offered to the selector. Defaults to the SCRAM-only SASL_AUTH_ORDER. Pass LEGACY_SASL_AUTH_ORDER explicitly when compatibility with PLAIN, DIGEST-MD5, or ANONYMOUS is required.


[View source]
def skip_cert_verify? : Bool #

skip_cert_verify can be set to true to allow to open a TLS session and skip verification of SSL certs


[View source]
def tls? : Bool #

[View source]
def tls_ca_certificates : String | Nil #

[View source]
def transport : TransportMode #

Connection transport: TransportMode::Tcp (default), WebSocket (RFC 7395), Bosh (XEP-0206), or Auto (TCP first, then XEP-0156 discovery).


[View source]
def url : String | Nil #

Explicit connection endpoint for the WebSocket (RFC 7395) or BOSH (XEP-0206) transports: ws:// or wss:// for WebSocket, http:// or https:// for BOSH. Overrides discovery; falls back to a derived default when nil.


[View source]