Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A simple PHP WebSocket implementation for PHP 5.3
branch: master

This branch is 9 commits ahead, 227 commits behind varspool:master

Merge pull request #8 from colin1124x/master

fixed when get 401 , fclose  Socket will fail and $matches may get null

PHP WebSocket

A websocket server implemented in php.

  • Supports websocket draft hybi-10,13 (Currently tested with Chrome 18 and Firefox 11).
  • Supports origin-check.
  • Supports various security/performance settings.
  • Supports binary frames. (Currently receive only)
  • Supports wss. (Needs valid certificate in Firefox.)
  • Application module, the server can be extended by custom behaviors.


  • Add support for fragmented frames.

Server example

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

$server = new \WebSocket\Server('', 8000, false); // host,port,ssl

// server settings: 

$server->registerApplication('demo', \WebSocket\Application\DemoApplication::getInstance());

Libraries used


  • Check out for a sample-project using this websocket server.
Something went wrong with that request. Please try again.