PHPackages                             zorn-v/xmpp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. zorn-v/xmpp

ActiveLibrary[HTTP &amp; Networking](/categories/http)

zorn-v/xmpp
===========

Library for XMPP protocol (Jabber) connections

1.2.1(1y ago)118.6k3[4 issues](https://github.com/zorn-v/xmpp/issues)BSD-2-ClausePHPPHP ^7.2 || ^8.0

Since Jan 23Pushed 1y ago4 watchersCompare

[ Source](https://github.com/zorn-v/xmpp)[ Packagist](https://packagist.org/packages/zorn-v/xmpp)[ Docs](https://github.com/zorn-v/xmpp)[ RSS](/packages/zorn-v-xmpp/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (4)Versions (23)Used By (0)

Library for XMPP protocol connections (Jabber) for PHP.

SYSTEM REQUIREMENTS
-------------------

[](#system-requirements)

- PHP &gt;= 7.2
- psr/log
- (optional) psr/log-implementation - like monolog/monolog for logging

INSTALLATION
------------

[](#installation)

Install [Composer](https://getcomposer.org/download/) and then

```
composer require zorn-v/xmpp
```

DOCUMENTATION
-------------

[](#documentation)

You can check `example.php` for auto reply bot example

This library uses an object to hold options:

```
use Fabiang\Xmpp\Options;
$options = new Options($address);
$options->setUsername($username)
    ->setPassword($password);
```

The server address must be in the format `myjabber.com:5222`. If the server supports TLS the connection will automatically be encrypted.

If you want to use SOCKS proxy you can set it by

```
$options->setSocksProxyAddress('localhost:9050');
```

or

```
$options->setSocksProxyAddress('username:password@localhost:9050');
```

You can also pass a PSR-3 compatible object to the options object:

```
$options->setLogger($logger);
```

The client manages the connection to the Jabber server and requires the options object:

```
use Fabiang\Xmpp\Client;
$client = new Client($options);
// optional connect manually
$client->connect();
```

You can use `getMessages()` for get all incoming messages

```
print_r($client->getMessages());
```

```
Array
(
    [0] => Array
        (
            [from] => user@myjabber.com/resource
            [message] => Message text
        )

)

```

For sending data you just need to pass a object that implements `Fabiang\Xmpp\Protocol\ProtocolImplementationInterface`:

```
use Fabiang\Xmpp\Protocol\Roster;
use Fabiang\Xmpp\Protocol\Presence;
use Fabiang\Xmpp\Protocol\Message;

// fetch roster list; users and their groups
$client->send(new Roster);
// set status to online
$client->send(new Presence);

// send a message to another user
$message = new Message;
$message->setMessage('test')
    ->setTo('nickname@myjabber.com');
$client->send($message);

// join a channel
$channel = new Presence;
$channel->setTo('channelname@conference.myjabber.com/nickname')
    ->setPassword('channelpassword');
$client->send($channel);

// send a message to the above channel
$message = new Message;
$message->setMessage('test')
    ->setTo('channelname@conference.myjabber.com')
    ->setType(Message::TYPE_GROUPCHAT);
$client->send($message);
```

After all you should disconnect:

```
$client->disconnect();
```

DEVELOPING
----------

[](#developing)

If you like this library and you want to contribute, make sure the unit-tests and integration tests are running. Composer will help you to install the right version of PHPUnit and [Behat](http://behat.org/).

```
composer install

```

After that:

```
./vendor/bin/phpunit
./vendor/bin/behat

```

New features should always tested with Behat.

LICENSE
-------

[](#license)

BSD-2-Clause. See the [LICENSE](LICENSE.md).

TODO
----

[](#todo)

- Better integration of channels
- Factory method for server addresses
- improve documentation

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 86.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~240 days

Recently: every ~88 days

Total

18

Last Release

466d ago

Major Versions

0.8.4 → 1.0.02024-04-05

PHP version history (5 changes)0.1.0PHP &gt;=5.3

0.5.0PHP &gt;=5.3.3

0.7.0PHP ^5.6 || ^7.0

0.8.2PHP ^5.6 || ^7.0 || ^8.0

1.1.0PHP ^7.2 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/33c8ff5d70d1ab0c46bb780088dfa75f5e3d7a7412fa9f6408cfc1b5b2aeff87?d=identicon)[zorn-v](/maintainers/zorn-v)

---

Top Contributors

[![fabiang](https://avatars.githubusercontent.com/u/348344?v=4)](https://github.com/fabiang "fabiang (153 commits)")[![zorn-v](https://avatars.githubusercontent.com/u/12619075?v=4)](https://github.com/zorn-v "zorn-v (15 commits)")[![n10ty](https://avatars.githubusercontent.com/u/2970001?v=4)](https://github.com/n10ty "n10ty (2 commits)")[![Ghitu](https://avatars.githubusercontent.com/u/7511010?v=4)](https://github.com/Ghitu "Ghitu (1 commits)")[![alexalouit](https://avatars.githubusercontent.com/u/1419377?v=4)](https://github.com/alexalouit "alexalouit (1 commits)")[![marclaporte](https://avatars.githubusercontent.com/u/1004261?v=4)](https://github.com/marclaporte "marclaporte (1 commits)")[![pirxthepilot](https://avatars.githubusercontent.com/u/7690118?v=4)](https://github.com/pirxthepilot "pirxthepilot (1 commits)")[![iivannov](https://avatars.githubusercontent.com/u/7932620?v=4)](https://github.com/iivannov "iivannov (1 commits)")[![antonkomarev](https://avatars.githubusercontent.com/u/1849174?v=4)](https://github.com/antonkomarev "antonkomarev (1 commits)")[![frederikbosch](https://avatars.githubusercontent.com/u/1552577?v=4)](https://github.com/frederikbosch "frederikbosch (1 commits)")

---

Tags

xmppjabber

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zorn-v-xmpp/health.svg)

```
[![Health](https://phpackages.com/badges/zorn-v-xmpp/health.svg)](https://phpackages.com/packages/zorn-v-xmpp)
```

###  Alternatives

[symfony/http-kernel

Provides a structured process for converting a Request into a Response

8.1k869.4M8.8k](/packages/symfony-http-kernel)[symfony/http-client

Provides powerful methods to fetch HTTP resources synchronously or asynchronously

2.0k338.8M5.0k](/packages/symfony-http-client)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[api-platform/metadata

API Resource-oriented metadata attributes and factories

275.0M219](/packages/api-platform-metadata)[bitrix24/b24phpsdk

An official PHP library for the Bitrix24 REST API

10244.2k5](/packages/bitrix24-b24phpsdk)[mimmi20/browser-detector

Library to detect Browsers and Devices

48157.5k5](/packages/mimmi20-browser-detector)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
