Expand description
Low-level XMPP decentralized instant messaging & social networking implementation with asynchronous I/O using tokio.
For an easier, batteries-included experience, try the xmpp crate.
§Getting started
In most cases, you want to start with a Client
, that will connect to a server over TCP/IP with StartTLS encryption. Then, you can build an event loop by calling the client’s next
method repeatedly. You can find a more complete example in the examples/echo_bot.rs file in the repository.
§Features
This library is not feature-complete yet. Here’s a quick overview of the feature set.
Supported implementations:
- Clients
- Components
- Servers
Supported transports:
- Plaintext TCP (IPv4/IPv6)
- StartTLS TCP (IPv4/IPv6 with happy eyeballs support)
-
Custom connectors via the
connect::ServerConnector
trait - Websockets
- BOSH
§Cargo features
§TLS backends
aws_lc_rs
(default) enables rustls with theaws_lc_rs
backend.ring
enables rustls with thering
backend`.rustls-any-backend
enables rustls, but without enabling a backend. It is the application’s responsibility to ensure that a backend is enabled and installed.ktls
enables the use of ktls. Important: Currently, connections will fail if thetls
kernel module is not available. There is no fallback to non-ktls connections!native-tls
enables the system-native TLS library (commonly libssl/OpenSSL).
Note: It is not allowed to mix rustls-based TLS backends with
tls-native
. Attempting to do so will result in a compilation error.
Note: The ktls
feature requires at least one rustls
backend to be
enabled (aws_lc_rs
or ring
).
Note: When enabling not exactly one rustls backend, it is the
application’s responsibility to make sure that a default crypto provider is
installed in rustls
. Otherwise, all TLS connections will fail.
§Certificate validation
When using native-tls
, the system’s native certificate store is used.
Otherwise, you need to pick one of the following to ensure that TLS
connections will succeed:
rustls-native-certs
(default): Uses rustls-native-certs.webpki-roots
: Uses webpki-roots.
§Other features
starttls
(default): Enables support for<starttls/>
. Required as per RFC 6120.insecure-tcp
: Allow the use of insecure TCP connections to connect to XMPP servers. Required for XMPP components, but disabled by default to prevent accidental use.serde
: Enable theserde
feature inxmpp-parsers
.component
: Enable component support (impliesinsecure-tcp
).
§More information
You can find more information on our website xmpp.rs or by joining our chatroom chat@xmpp.rs.
Re-exports§
pub use parsers::jid;
pub use parsers::minidom;
pub use xmpp_parsers as parsers;
pub use tokio_rustls::rustls;
ring
oraws_lc_rs
orktls
Modules§
- connect
ServerConnector
provides streams for XMPP clients- error
- Detailed error types
- stanzastream
- Resilient stanza stream
- xmlstream
- RFC 6120 XML Streams
Structs§
- Client
- XMPP client connection and state
- Component
insecure-tcp
- Component connection to an XMPP server
- IqResponse
Token - Handle for awaiting an IQ response.
- Print
RawXml - Provides a helper which implements Display printing raw XML