XMPP¶
XMPP (Extensible Messaging and Presence Protocol) is an open protocol for near-real-time messaging. Shoutrrr's XMPP service enables sending fire-and-forget chat and multi-user chat (MUC) notifications to XMPP servers, such as ejabberd and Prosody. Upstream docs: https://xmpp.org/
URL Formats¶
The XMPP service supports two URL schemes for connection security:
xmpp://: STARTTLS, default port 5222
xmpp://USER:PASSWORD@HOST[:PORT]/?to=JID[&rooms=ROOM_JID]
xmpps://: implicit TLS, default port 5223
xmpps://USER:PASSWORD@HOST[:PORT]/?to=JID[&rooms=ROOM_JID]
URL Fields¶
- User - Auth JID localpart or full JID (Required)
URL part: User - Password - Auth password (Required)
URL part: Password - Host - XMPP server hostname (Required)
URL part: Host - Port - XMPP server port (Required)
URL part: Port
Query/Param Props¶
Props can be either supplied using the params argument or through the URL using
?key=value&key=value etc.
-
disabletls - Disable TLS (xmpp:// only) Default: ❌
No -
nick - MUC nickname Default: empty
-
roompassword - Password for protected MUC rooms Default: empty
-
rooms - MUC room JIDs Default: empty
-
skiptlsverify - Skip TLS certificate verification Default: ❌
No -
title - Optional title prepended to the message body Default: empty
-
to - Chat recipient JIDs Default: empty
At least one of to or rooms is required.
Authentication JID¶
The URL userinfo is the login identity:
- A localpart (
alice) becomesalice@HOST. - A full JID (
alice%40jabber.example.com) is used as-is.
xmpp://alice%40jabber.example.com:[email protected]/[email protected]
The server's certificate is checked against the domain of the JID, as RFC 6120 requires.
In the example, that domain is jabber.example.com.
With a full JID, HOST can therefore be any name or address of the server.
Finding the Server¶
Without a port, Shoutrrr finds the server through the SRV records of the JID's domain, as RFC 6120 prefers.
This applies when HOST is the JID's domain, which it always is for a localpart user.
xmpp://reads the_xmpp-client._tcprecords, andxmpps://reads the_xmpps-client._tcprecords that XEP-0368 defines.- Shoutrrr dials the servers they name in order of priority and weight, until one connects. Each server but the last gets at most 10 seconds.
- Without records, Shoutrrr dials
HOSTat port 5222 forxmpp://, or 5223 forxmpps://. - Once the domain has records,
HOSTitself is not dialed. - A single record whose target is
.means the domain offers no XMPP service for the scheme, so the send fails.
Shoutrrr dials HOST without a lookup in three cases.
- The URL has a port, which Shoutrrr dials.
- The user is a full JID whose domain is not
HOST. HOSTis an IP address.
In the last two cases, Shoutrrr dials the scheme's default port.
A custom dial function set through the Go API also carries the DNS queries.
One that refuses them makes Shoutrrr dial HOST as it would without records.
TLS¶
- Use
xmpp://for STARTTLS. - Use
xmpps://for implicit TLS. Shoutrrr offers thexmpp-clientALPN protocol, as XEP-0368 asks. - Use
disabletls=yesonly withxmpp://for plaintext on a trusted network. Combining it withxmpps://is rejected. - Use
skiptlsverify=yesto skip certificate verification (self-signed or internal TLS). TLS 1.2 remains the minimum.
Shoutrrr logs a warning the first time a send skips certificate verification, and the first time a send goes out without TLS.
Plaintext SASL is used only when disabletls=yes is set.
Encrypted connections prefer SCRAM-SHA-256, then SCRAM-SHA-1, then PLAIN.
Recipients¶
to: comma-separated JIDs sent as type=chat.rooms: comma-separated MUC JIDs. The service joins, sends type=groupchat, and leaves.nick: MUC nickname. Defaults to the auth JID localpart.roompassword: password applied to every room in the URL.
A title is prepended to the message body. The MUC subject is never changed.
Examples¶
Direct chat¶
xmpp://alice:[email protected]/[email protected]
Multiple chat recipients and a room¶
Implicit TLS with a self-signed certificate¶
xmpps://alice:[email protected]/[email protected]&skiptlsverify=yes
Password-protected room¶
xmpp://alice:[email protected]/[email protected]&nick=shoutrrr&roompassword=s3cret