diff --git a/echo.php b/echo.php index 15a95fe7..572341e6 100644 --- a/echo.php +++ b/echo.php @@ -6,16 +6,15 @@ use Laravel\Reverb\WebSockets\WsConnection; use Psr\Http\Message\RequestInterface; use React\EventLoop\Loop; -use React\Http\HttpServer; use React\Socket\SocketServer; use Symfony\Component\Routing\Matcher\UrlMatcher; use Symfony\Component\Routing\RequestContext; use Symfony\Component\Routing\RouteCollection; -require __DIR__ . '/vendor/autoload.php'; +require __DIR__.'/vendor/autoload.php'; $loop = Loop::get(); -$socket = new SocketServer("0.0.0.0:8080", [], $loop); +$socket = new SocketServer('0.0.0.0:8080', [], $loop); $router = new Router(new UrlMatcher(routes(), new RequestContext)); $server = new Server($socket, $router, $loop); @@ -28,7 +27,7 @@ function routes() { $routes = new RouteCollection; $routes->add( - 'sockets', + 'sockets', Route::get('/', function (RequestInterface $request, WsConnection $connection) { $connection->onMessage(function ($message) use ($connection) { $connection->send($message); @@ -38,4 +37,4 @@ function routes() ); return $routes; -} \ No newline at end of file +}