Download the PHP package sowe/peerserver without Composer

On this page you can find all versions of the php package sowe/peerserver. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package peerserver

PHPPeerServer

PHP Socket.io server for WebRTC signaling.

Client: https://github.com/jsanahuja/peer-client

Demo: https://peer-demo.sowecms.com/

Install

Clone both client and server and install dependencies.

Create your server configuration file

Generate your Keychain private key:

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

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

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

Management

Here you can see a list of the available commands: https://github.com/walkor/Workerman#available-commands

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

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.


All versions of peerserver with dependencies

PHP Build Version
Package Version
Requires workerman/phpsocket.io Version ^1.1
monolog/monolog Version ^2.0
sowe/framework Version ^1.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sowe/peerserver contains the following files

Loading the files please wait ....