aabalexander / php-websockets
General Purpose PHP Websockets
2.0-alpha1
2018-09-06 04:05 UTC
This package is not auto-updated.
Last update: 2025-07-06 23:24:49 UTC
README
This library is in an early Alpha state, and is not useful right now for any purpose other than showing error messages.
It extends concepts I learned in my original WebSockets library, and implements it in a way that's not quite so... amateur and embarrassing.
Examples will appear at my Examples repository
Intended use is:
<?php
// Assuming your code is in your project's "/code" or similar directory
require_once (__DIR__ . '/../vendor/autoload.php');
$webSocketsDiContainer = new GpwsDIContainer();
$server = $webSocketsDiContainer->getWebsocketServer();
$server->setListenAddress('0.0.0.0', 8080);
$eventHandler = new MyAppsEventHandler();
$server->registerEventHandler($eventHandler);
$server->run();
// cleanup.
I do have Patreon goals. As my personal financial situation becomes less dire, I'll be more able to provide support for the community.