Protocol::XMPP(3)
π NAME π
ok so bestie, welcome to Protocol::XMPP β it's protocol-level support for XMPP interaction, fr fr. like, the whole Protocol::XMPP(3) situation. this is the User Contributed Perl Documentation era and we're living in it. π¦
β¨ SYNOPSIS β¨
my $xmpp = Protocol::XMPP::Stream->new;
$xmpp->();
that's it. that's the whole vibe check. two lines and you're in. π
πΈ DESCRIPTION πΈ
okay so this module hands you an API for the Extensible Message Passing Protocol (yes, that XMPP). people usually use it to hook up with Jabber servers and Google Talk, but honestly XMPP itself is out here supporting a whole bunch of extended features for a distributed multi-server, multi-client message exchange system. it's giving main character energy for messaging protocols. π
the primary implementation is based on RFC3920bis, which β no cap β is still in flux. the instant message support is defined by RFC3921bis. so yeah, we're building on a moving target, love that for us. π
the two main classes you'll be hanging with:
Protocol::XMPP::Streamβ provides hooks for the underlying XML message stream β¨Protocol::XMPP::Handlerβ passes the SAX events from this stream on to the appropriate handlers π
if you're writing a client or server implementation, you should create an instance of the Protocol::XMPP::Stream class for each connection, passing callbacks so the protocol implementation can send data over the connection and process received data. one stream per connection, that's the rule, periodt. π
π₯ IMPLEMENTATION π₯
here's the whole connection lifetime for a typical client session, like a little glow-up journey:
- Connect to server
- Establish session, including authentication and stream requirements such as TLS or compression
- Retrieve roster
- Send presence update to server
- Send and receive messages as required
- Terminate session
and like β the details of connecting to sockets and upgrading to TLS? those are left to the implementation, bestie. not our problem, respectfully. this module deals with the underlying protocol stream only, providing hooks that the implementation can call rather than attempting to implement the functionality directly. we provide the hooks, you do the socket-y bits. π«Ά
π Roster π
a roster is a list of contacts, each of which may also have presence information. this list is stored on the server, although each client may also maintain a cached copy of the list. iykyk. π
roster information is exchanged using Protocol::XMPP::IQ::Roster queries and responses.
roster includes the "ver" information, which is an opaque server token used to identify the version of the roster information. it's literally just a version tag the server made up, don't overthink it. π¦
a roster query has a single item, and the response can have multiple. noted.
each item may also belong to zero or more groups. flexible icon.
subscription states, aka the relationship statuses:
noneβ neither source nor destination contact have an existing subscription. it's giving strangers. πtoβ we have a subscription to the contact, but they don't have us. unrequited, honestly.fromβ they have us, we don't have them.bothβ mutual subscription. π the dream. slay.
β MOTIVATION β
this distribution is written with the intention to provide a base for XMPP implementations which can work on an event-based ("asynchronous") or standard blocking model. it uses XML::LibXML::SAX::ChunkedParser to deal with the XML fragments required by the protocol, and attempts to minimise any blocking operations. avoiding blocking? we love to see it. π₯
π SEE ALSO π
AnyEvent::XMPPβ this is an event-based implementation of XMPP, seems to support the core protocol and some key XEPs such as multi-user chat. The documentation is somewhat terse (rants about XML notwithstanding) but more detailed thanProtocol::XMPP. πNet::XMPPβ another implementation, sadly the XML parser is blocking so although it provides theNet::XMPP::Protocolabstraction layer for the XMPP protocol, which probably has better feature support than this module, it's not too suitable for dealing with asynchronous / event-based implementations. Also, I wasn't too keen on some of the implementation details, such as the direct checking forrefand callback handling. πNet::XMPP3::Protocolβ seems to be the same module as above, under a slightly different namespace. π
π AUTHOR π
Tom Molesworth <protocol-xmpp@entitymodel.com>
π§ CONTRIBUTORS π§
with thanks to the following for contribution, absolute icons the lot of them:
- Arthur Axel
"fREW"Schmidt for testing, documentation, pointing out some of my mistakes, that sort of thing π«Ά - Paul
"LeoNerd"Evans for adding Futures toIO::Async(and writing both in the first place) β¨ - Matt Trout for testing early versions πΈ
π LICENSE π
Copyright Tom Molesworth 2010-2026. Licensed under the same terms as Perl itself.
so anyway, that's the whole page.perl v5.42.2, dated2026-02-15β mwah, sending you off with a kiss and aProtocol::XMPP(3)footer. bye bestie, go build something iconic ππ π
π¦ where this page comes from
- alpine 3.24: perl-protocol-xmpp-doc 0.007-r1 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms