◐ Shell
clean mode source ↗

GitHub - xrogers/php-websocket: A simple PHP WebSocket implementation for PHP 5.3

A simple PHP WebSocket server and client. ATTENTION: Totally beta and just for testing/development!

  • Supports draft hybi-10
  • Application module, the server can be extended by custom behaviors

Server example

This creates a server on localhost:8000 with one Application that listens on ws://localhost:8000/echo:

$server = new \WebSocket\Server('localhost', 8000);
$server->registerApplication('echo', \WebSocket\Application\EchoApplication::getInstance());
$server->run();

Libraries used