abstract class XMPP::Transport

Overview

A transport presents a classic XMPP byte stream (<stream:stream> in, top-level elements out) over the underlying connection protocol. Session and XMLStreamReader read and write complete logical elements through this single abstraction, so SASL, stream management, and auth are untouched.

Direct Known Subclasses

Defined in:

xmpp/transport/transport.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.connect(config : Config) : Transport #

[View source]

Class Method Detail

def self.classify_outbound(data : String) : Symbol #

Classifies one outbound write from the session into the logical units the message transports care about.


[View source]
def self.extract_attribute(xml : String, name : String) : String | Nil #

[View source]

Instance Method Detail

abstract def encrypted? : Bool #

True when TLS is already handled at or below this transport, so the session must not attempt a STARTTLS upgrade.


[View source]
def supports_starttls? : Bool #

Whether the session must negotiate a STARTTLS upgrade on this transport before authentication. Only a plaintext TCP stream does; WebSocket and BOSH transports have no STARTTLS (their security is fixed at connection time by ws/wss or http/https), so the RFC 7590 anti-stripping attempt must not run against them.


[View source]
abstract def tls_socket : OpenSSL::SSL::Socket::Client | Nil #

The underlying TLS socket when the transport opened one directly (XEP-0368 direct TLS). Nil for plaintext, STARTTLS-managed, WebSocket, and BOSH transports.


[View source]