Server running but nothing is displayed
ace411 opened this issue · comments
Hello,
I've attempted to use your package to set up a simple server to print a message, hello. I have failed to get any output on the console or in the browser. My code appears as follows:
$server = new Rx\Websocket\Server('127.0.0.1:8020');
$server->subscribe(
function (Rx\Websocket\MessageSubject $subject) {
$subject->subscribe(
function ($message) {
echo $message . PHP_EOL;
}
);
$sayHello = function () use ($subject) {
$subject->onNext('Hello');
};
$sayHello();
\EventLoop\addPeriodicTimer(5, $sayHello);
},
function ($error) {
echo "Connection Error";
},
function () {
echo "Completed";
}
);
I do however get a 500 server error.