---
name: "AnyEvent::XMPP::Component"
section: "3pm"
platform: "linux"
package: "perl-anyevent-xmpp"
version: "0.55-7"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/AnyEvent::XMPP::Component"
---

# AnyEvent::XMPP::Component(3pm)

"XML" stream that implements the XEP-0114

## NAME

AnyEvent::XMPP::Component - "XML" stream that implements the XEP-0114

## SYNOPSIS

```
   use AnyEvent::XMPP::Component;
   my $con = AnyEvent::XMPP::Component->new (
                domain => 'chat.jabber.org'
                host   => 'jabber.org',
                port   => 5347,
                secret => 'insecurepasswordforthehackers'
             );
   $con->reg_cb (session_ready => sub { ... });
   $con->connect;
```

## DESCRIPTION

This module represents a XMPP connection to a server that authenticates as component.

This module is a subclass of `"AnyEvent::XMPP::Connection"` and inherits all methods. For example `"reg_cb"` and the stanza sending routines.

For additional events that can be registered to look below in the EVENTS section.

Please note that for component several functionality in AnyEvent::XMPP::Connection might have no effect or not the desired effect. Basically you should use the AnyEvent::XMPP::Component as component and only handle events the handle with incoming data. And only use functions that send stanzas.

No effect has the event `"stream_pre_authentication"` and the `"authenticate"` method of AnyEvent::XMPP::Connection, because those handle the usual SASL or iq-auth authentication. "Jabber" components have a completly different authentication mechanism.

Also note that the support for some XEPs in AnyEvent::XMPP::Ext is just thought for client side usage, if you miss any functionaly don't hesitate to ask the author or send him a patch! (See AnyEvent::XMPP for contact information).

## METHODS

- **new (%args)**

  This is the constructor. It takes the same arguments as the constructor of AnyEvent::XMPP::Connection along with a few others:

  **NOTE**: Please note that some arguments that AnyEvent::XMPP::Connection usually takes have no effect when using this class. (That would be the 'username', 'password', 'resource' and 'jid' arguments for example.)

  - secret =\> $secret

    `$secret` is the secret that will be used for authentication with the server.

## EVENTS

These additional events can be registered on with `"reg_cb"`:

NOTE: The event `"stream_pre_authentication"` should \_not\_ be handled and just ignored. Don't attach callbacks to it!

- session\_ready

  This event indicates that the component has connected successfully and can now be used to transmit stanzas.

## AUTHOR

Robin Redeker, `"<elmex at ta-sa.org>"`, JID: `"<elmex at jabber.org>"`

## COPYRIGHT & LICENSE

Copyright 2007, 2008 Robin Redeker, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
