{"id":15724233,"url":"https://github.com/jsanahuja/php-peer-server","last_synced_at":"2025-08-22T14:08:33.211Z","repository":{"id":57056199,"uuid":"258627905","full_name":"jsanahuja/php-peer-server","owner":"jsanahuja","description":"WebRTC P2P Rooms. PHP Socket.io server for WebRTC signaling.","archived":false,"fork":false,"pushed_at":"2021-04-14T17:49:09.000Z","size":67,"stargazers_count":16,"open_issues_count":0,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-16T06:49:26.604Z","etag":null,"topics":["room","rooms","signaling","signaling-server","video-room","webrtc","webrtc-signaling","webrtc-signaling-server","webrtc-video"],"latest_commit_sha":null,"homepage":"https://peer-demo.sowecms.com/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jsanahuja.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"custom":["https://www.paypal.me/JavierSL"]}},"created_at":"2020-04-24T21:25:40.000Z","updated_at":"2025-02-15T15:15:19.000Z","dependencies_parsed_at":"2022-08-24T14:00:39.556Z","dependency_job_id":null,"html_url":"https://github.com/jsanahuja/php-peer-server","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jsanahuja/php-peer-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsanahuja%2Fphp-peer-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsanahuja%2Fphp-peer-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsanahuja%2Fphp-peer-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsanahuja%2Fphp-peer-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsanahuja","download_url":"https://codeload.github.com/jsanahuja/php-peer-server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsanahuja%2Fphp-peer-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271650860,"owners_count":24796725,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-22T02:00:08.480Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["room","rooms","signaling","signaling-server","video-room","webrtc","webrtc-signaling","webrtc-signaling-server","webrtc-video"],"created_at":"2024-10-03T22:15:39.265Z","updated_at":"2025-08-22T14:08:33.169Z","avatar_url":"https://github.com/jsanahuja.png","language":"PHP","funding_links":["https://www.paypal.me/JavierSL"],"categories":[],"sub_categories":[],"readme":"# PHPPeerServer\nPHP Socket.io server for WebRTC signaling.\n\nClient: https://github.com/jsanahuja/peer-client\n\nDemo: https://peer-demo.sowecms.com/\n\n## Install\nClone both client and server and install dependencies.\n```\ngit clone https://github.com/jsanahuja/php-peer-server.git\ngit clone https://github.com/jsanahuja/peer-client.git\ncd php-peer-server \ncomposer install\ncd ../peer-client\nnpm install\nnpm run build\n```\n\nCreate your server configuration file\n```\ncd ../php-peer-server\ncp config.example.php config.php\n```\nGenerate your Keychain private key:\n```\nphp make_keychain.php\n```\n\u003e Result example: 1949e2278ea5767099e592ae8dd15677ecf851efd177a1f0fb1d44e8e79231f5\n\nPlace 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.\n\nStart the server as a daemon\n```\nphp server.php start -d\n```\n\nDo not forget to open/whitelist the `PORT` or the server won't be accessible. For example with `firewalld` you would do:\n```\nfirewall-cmd --zone=public --permanent --add-port=8999/tcp\nfirewall-cmd --reload\n```\n\nNote: The HTTP server should be pointing to the `peer-client` folder.\n\n## Management\n\nHere you can see a list of the available commands: https://github.com/walkor/Workerman#available-commands\n\n## Server actions\n\nThe following is the list of events you can send to the server. For example `socket.emit('join', 'a68ca609389b6ba7f0766b9ed1bfd8ca')`\n\n\u003e `create(name, password)` creates a room.\n\n\u003e `join(roomId, password)` joins a room.\n\n\u003e `leave()` leaves the current room.\n\n\u003e `kick(userId)` kicks an user from the room. Can only be used by the creator.\n\n\u003e `ban(userId)` bans an user from the room. Can only be used by the creator.\n\n\u003e `unban(userId)` unbans an user from the room. Can only be used by the creator.\n\n\u003e `message(msg)` sends a message to the current room.\n\n\u003e `toggle(resource)` toggles a resource. The resources are 'video', 'microphone' and 'audio'.\n\n\u003e `candidate(callId, candidate)` sends a candidate.\n\n\u003e `offer(callId, offer)` sends an offer. Must have been requested with the `call` event.\n\n\u003e `answer(callId, answer)` sends an answer. Must have been requested with the `offer` event.\n\n## Server responses\n\nThe following are the events the server will trigger.\n\n\u003e `created(roomId)` confirms you created a room.\n\n\u003e `joined(roomId)` confirms you joined the room.\n\n\u003e `left(roomId)` confirms you left the room.\n\n\u003e `kicked` notifies that you have been kicked from the room.\n\n\u003e `banned` notifies that you have been banned from the room.\n\n\u003e `unbanned` notifies that you have been unbanned from a room.\n\n\u003e `call(callId)` requests an offer for the call\n\n\u003e `offer(callId, offer)` sends and offer and requires an answer\n\n\u003e `answer(callId, answer)` sends an answer to the offer\n\n\u003e `hangup(callId)` notifies that the call was closed\n\nAlso the error events:\n\n\u003e `join_alreadyin` notifies you can't join the room because you're already in.\n\n\u003e `join_wrongpass` notifies you can't join the room because the password provided is wrong.\n\n\u003e `join_full` notifies you can't join the room because it is full.\n\n\u003e `join_banned` notifies you can't join the room because you are banned.\n\n\u003e `kick_noprivileges` notifies you don't have enough privileges to kick in the current room.\n\n\u003e `kick_notin` notifies that the user you tried to kick is no longer in the room.\n\n\u003e `ban_noprivileges` notifies you don't have enough privileges to ban in the current room.\n\n\u003e `ban_already` notifies that the user you tried to ban is already banned.\n\n\u003e `unban_noprivileges` notifies you don't have enough privileges to unban in the current room.\n\n\u003e `unban_notbanned` notifies you have tried to unban an user that wasn't banned.\n\nAnd the room events:\n\n\u003e `r_message(userId, message)` someone in your room sent a text message in your room.\n\n\u003e `r_resource(userId, resource, status)` someone in your room toggled the status of one of its resources.\n\n\u003e `r_joined(userId)` an user joined your room.\n\n\u003e `r_left(userId)` an user left your room.\n\n\u003e `r_kicked(userId)` an user was kicked out of your room.\n\n\u003e `r_banned(userId)` an user from your room was banned.\n\n\u003e `r_unbanned(userId)` an user has been unbanned.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsanahuja%2Fphp-peer-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsanahuja%2Fphp-peer-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsanahuja%2Fphp-peer-server/lists"}