PHPackages                             sowe/peerserver - 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. sowe/peerserver

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

sowe/peerserver
===============

PHP Socket.io server for WebRTC signaling

0.0.10(5y ago)1678MITPHP

Since Apr 14Pushed 5y ago2 watchersCompare

[ Source](https://github.com/jsanahuja/php-peer-server)[ Packagist](https://packagist.org/packages/sowe/peerserver)[ Fund](https://www.paypal.me/JavierSL)[ RSS](/packages/sowe-peerserver/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

PHPPeerServer
=============

[](#phppeerserver)

PHP Socket.io server for WebRTC signaling.

Client:

Demo:

Install
-------

[](#install)

Clone both client and server and install dependencies.

```
git clone https://github.com/jsanahuja/php-peer-server.git
git clone https://github.com/jsanahuja/peer-client.git
cd php-peer-server
composer install
cd ../peer-client
npm install
npm run build

```

Create your server configuration file

```
cd ../php-peer-server
cp config.example.php config.php

```

Generate your Keychain private key:

```
php make_keychain.php

```

> Result example: 1949e2278ea5767099e592ae8dd15677ecf851efd177a1f0fb1d44e8e79231f5

Place the result in the constant `KEYCHAIN_PK` defined in the `config.php` file we just created. Set also the absolute path to your `CERT_CA` and `CERT_KEY` files. You can play with the other constant values but it should be good to go. Note that if you want to change the `PORT` you will have to change it in the `peer-client` too.

Start the server as a daemon

```
php server.php start -d

```

Do not forget to open/whitelist the `PORT` or the server won't be accessible. For example with `firewalld` you would do:

```
firewall-cmd --zone=public --permanent --add-port=8999/tcp
firewall-cmd --reload

```

Note: The HTTP server should be pointing to the `peer-client` folder.

Management
----------

[](#management)

Here you can see a list of the available commands:

Server actions
--------------

[](#server-actions)

The following is the list of events you can send to the server. For example `socket.emit('join', 'a68ca609389b6ba7f0766b9ed1bfd8ca')`

> `create(name, password)` creates a room.

> `join(roomId, password)` joins a room.

> `leave()` leaves the current room.

> `kick(userId)` kicks an user from the room. Can only be used by the creator.

> `ban(userId)` bans an user from the room. Can only be used by the creator.

> `unban(userId)` unbans an user from the room. Can only be used by the creator.

> `message(msg)` sends a message to the current room.

> `toggle(resource)` toggles a resource. The resources are 'video', 'microphone' and 'audio'.

> `candidate(callId, candidate)` sends a candidate.

> `offer(callId, offer)` sends an offer. Must have been requested with the `call` event.

> `answer(callId, answer)` sends an answer. Must have been requested with the `offer` event.

Server responses
----------------

[](#server-responses)

The following are the events the server will trigger.

> `created(roomId)` confirms you created a room.

> `joined(roomId)` confirms you joined the room.

> `left(roomId)` confirms you left the room.

> `kicked` notifies that you have been kicked from the room.

> `banned` notifies that you have been banned from the room.

> `unbanned` notifies that you have been unbanned from a room.

> `call(callId)` requests an offer for the call

> `offer(callId, offer)` sends and offer and requires an answer

> `answer(callId, answer)` sends an answer to the offer

> `hangup(callId)` notifies that the call was closed

Also the error events:

> `join_alreadyin` notifies you can't join the room because you're already in.

> `join_wrongpass` notifies you can't join the room because the password provided is wrong.

> `join_full` notifies you can't join the room because it is full.

> `join_banned` notifies you can't join the room because you are banned.

> `kick_noprivileges` notifies you don't have enough privileges to kick in the current room.

> `kick_notin` notifies that the user you tried to kick is no longer in the room.

> `ban_noprivileges` notifies you don't have enough privileges to ban in the current room.

> `ban_already` notifies that the user you tried to ban is already banned.

> `unban_noprivileges` notifies you don't have enough privileges to unban in the current room.

> `unban_notbanned` notifies you have tried to unban an user that wasn't banned.

And the room events:

> `r_message(userId, message)` someone in your room sent a text message in your room.

> `r_resource(userId, resource, status)` someone in your room toggled the status of one of its resources.

> `r_joined(userId)` an user joined your room.

> `r_left(userId)` an user left your room.

> `r_kicked(userId)` an user was kicked out of your room.

> `r_banned(userId)` an user from your room was banned.

> `r_unbanned(userId)` an user has been unbanned.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

1857d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/35cf5aa5a22797c5f00672833fb320490a2e6ad68748be7c2ed0ba50d8eb9359?d=identicon)[jsanahuja](/maintainers/jsanahuja)

---

Top Contributors

[![jsanahuja](https://avatars.githubusercontent.com/u/16489902?v=4)](https://github.com/jsanahuja "jsanahuja (28 commits)")

---

Tags

roomroomssignalingsignaling-servervideo-roomwebrtcwebrtc-signalingwebrtc-signaling-serverwebrtc-video

### Embed Badge

![Health badge](/badges/sowe-peerserver/health.svg)

```
[![Health](https://phpackages.com/badges/sowe-peerserver/health.svg)](https://phpackages.com/packages/sowe-peerserver)
```

###  Alternatives

[mateusjunges/laravel-kafka

A kafka driver for laravel

7163.1M17](/packages/mateusjunges-laravel-kafka)[workerman/webman

High performance HTTP Service Framework.

2.6k86.6k68](/packages/workerman-webman)[akamai-open/edgegrid-client

Implements the Akamai {OPEN} EdgeGrid Authentication specified by https://developer.akamai.com/introduction/Client\_Auth.html

482.5M6](/packages/akamai-open-edgegrid-client)[onlime/laravel-http-client-global-logger

A global logger for the Laravel HTTP Client

1935.1k](/packages/onlime-laravel-http-client-global-logger)[huaweicloud/huaweicloud-sdk-php

Huawei Cloud SDK for PHP

1829.2k2](/packages/huaweicloud-huaweicloud-sdk-php)[opiy-org/asterisk-ari-php

An object-oriented client for the Asterisk REST Interface (ARI). Handles ARI calls and events for you.

121.1k](/packages/opiy-org-asterisk-ari-php)

PHPackages © 2026

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