Skip to content

bloatless/php-websocket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Bugs/Todos/Hints

  • 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('127.0.0.1', 8000, false); // host,port,ssl // server settings: $server->setCheckOrigin(true); $server->setAllowedOrigin('foo.lh'); $server->setMaxClients(100); $server->setMaxConnectionsPerIp(20); $server->setMaxRequestsPerMinute(1000); $server->registerApplication('demo', \WebSocket\Application\DemoApplication::getInstance()); $server->run(); 

Libraries used

Demo

  • Check out http://jitt.li for a sample-project using this websocket server.

About

Simple WebSocket server implemented in PHP.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 14

Languages