PHPackages                             thenlabs/socket-server - 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. thenlabs/socket-server

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

thenlabs/socket-server
======================

v1.1.7(4y ago)2541[1 issues](https://github.com/thenlabs/socket-server/issues)2MITPHP

Since Oct 11Pushed 4y agoCompare

[ Source](https://github.com/thenlabs/socket-server)[ Packagist](https://packagist.org/packages/thenlabs/socket-server)[ RSS](/packages/thenlabs-socket-server/feed)WikiDiscussions 1.1 Synced 1w ago

READMEChangelogDependencies (6)Versions (13)Used By (2)

SocketServer
============

[](#socketserver)

An useful library for creating asynchronous network applications with PHP.

> If you like this project gift us a ⭐.

Features.
---------

[](#features)

- Asynchronous connections.
- Multiple configuration options.
- Event system to implement the application logic.
- Logs support.

Installation.
-------------

[](#installation)

```
$ composer require thenlabs/socket-server

```

Usage.
------

[](#usage)

The below code show a bare network application that accept multiple connections and forward each incoming message to the rest of the connections.

> That application can be found in the `tests/Functional/hub.php` file. For test it you can run `php tests/Functional/hub.php`.

Can be seen that the `SocketServer` class offers the necessary events for react at the differents connection status.

> Check the `SocketServer` API for knows all his possibilities.

```
