Contains a generic PHP server and a JavaScript client. Just extend them to easily create wathever you want.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Websocket Framework v0.0.4

This project provide a way to easily create PHP websocket servers and JavaScript clients. You won't have to deal with socket listening, handshaking, data unmasking and such, it's all done by the framework.

Licence : GNU General Public License, version 3.0 (GPLv3)

Should you use it or not ?


Well, it was a nice experiment with PHP websockets, but you definetly want to use NodeJS instead !


  • Supports RFC 6455
  • Easy to use API
  • Only 10 lines of code to make a working server
  • Remote control of servers via a JavaScript client (kick clients, shutdown/reboot server, etc.)
  • Multiple servers architecture based on the same core
  • A groups system enabling internal communications between group clients (like a chatrooms in a chat)
  • Connected clients limit to prevent your servers from exploding


Demos included

Realtime 2D RPG

  • Players state are kept on the server, only keyboard events data are sent
  • Client-side movements predictions
  • Simple in-game chat
  • NPCs with a very basic AI
  • Support for different areas with different players inside
  • Players state can be saved in text files (JSON format)
Realtime Chat Remote admin control panel Hello world

TODOs list

  • Add a raw transport layer (raw_send()) for people who wants full control over optimisation
  • Add possibility to create custom admin commands
  • Add an helper to save and retrieve data in text files
  • Finish the 2D game demo
  • Create a realtime website demo
  • Create an online radio demo
  • Add an admin command to buffer server errors and retrieve them via remote client
  • Add a way to ban a client definitively with the Admin API