arttecs / murmur
A ReactPHP Server-Sent Events server with a Laravel bridge.
Requires
- php: ^8.3
- clue/redis-react: ^2.8
- firebase/php-jwt: ^7.2
- illuminate/auth: ^12.0|^13.0
- illuminate/broadcasting: ^12.0|^13.0
- illuminate/console: ^12.0|^13.0
- illuminate/contracts: ^12.0|^13.0
- illuminate/http: ^12.0|^13.0
- illuminate/redis: ^12.0|^13.0
- illuminate/routing: ^12.0|^13.0
- illuminate/support: ^12.0|^13.0
- illuminate/validation: ^12.0|^13.0
- psr/log: ^3.0
- react/child-process: ^0.6.7
- react/event-loop: ^1.6
- react/http: ^1.12
- react/promise: ^3
- react/promise-timer: ^1.11
- react/socket: ^1.17
- react/stream: ^1.4
Requires (Dev)
- laravel/pint: ^1.32
- orchestra/testbench: ^10.0|^11.0
- pestphp/pest: ^4.0|^5.0
- react/async: ^4
Suggests
- ext-ev: Support more than about 1000 concurrent connections.
- ext-event: Support more than about 1000 concurrent connections.
- ext-pcntl: Drain connections on SIGTERM and SIGINT.
- ext-posix: Let the worker detect parent death during a store write or listener call.
- ext-redis: Use the Redis driver from Laravel. Alternatively, install predis/predis.
- ext-uv: Support more than about 1000 concurrent connections.
- phpunit/phpunit: Use the Murmur testing assertions and driver conformance test cases.
Provides
None
Conflicts
None
Replaces
None
README
Murmur is a ReactPHP Server-Sent Events (SSE) server with a Laravel bridge. An SSE subscription can stay open for minutes or hours. When Laravel serves the stream directly through PHP-FPM, that connection holds a worker for its lifetime. Murmur keeps subscriptions in a separate, long-running process. Laravel publishes events over HTTP or Redis and continues serving requests with its workers available.
- No held workers. Subscriptions live in one event-loop process; PHP-FPM and Octane workers stay free.
- Laravel broadcasting. A
murmurbroadcaster, private channels authorized by Laravel's own/broadcasting/auth,toOthers(), and a Laravel Echo connector. - Replay on reconnect. Clients resume from their last event ID, and are told when history was lost.
- Scales out. Redis Streams share events and history across any number of Murmur nodes.
- Closed by default. Signed publishing, an empty origin allowlist, no metrics route, and optional features off until enabled.
- Observable. Health and readiness endpoints, Prometheus-format metrics, optional persisted snapshots, and connection lifecycle events.
Requirements
Murmur requires PHP 8.3 or later and Laravel 12 or 13. The server runs on Linux and macOS; Windows is not supported.
Installation
composer require arttecs/murmur php artisan murmur:install
The installer publishes config/murmur.php and sets up your application's Murmur environment.
Quick start
Start the server from your Laravel application directory.
php artisan murmur:serve
Open a public subscription in a separate terminal.
curl -N 'http://127.0.0.1:8080/sse?topics=news'
To subscribe from your browser application, install the client with npm install @arttecs/murmur and listen on the news channel. If the browser application uses a different origin from the SSE server, add its origin to MURMUR_ALLOWED_ORIGINS.
import { Murmur } from '@arttecs/murmur' const murmur = new Murmur({ url: 'http://127.0.0.1:8080/sse' }) const news = murmur.channel('news') news.listen('.updated', data => console.log(data))
Once the subscription has attached, publish an event from your Laravel application.
use Arttecs\Murmur\Facades\Murmur; Murmur::publish('news', 'updated', ['title' => 'New release']);
Documentation
Read the Murmur documentation.
- Installation
- Quick start
- Configuration
- Production
- Security
- Wire protocol
- Migrating from Laravel Reverb
- Compatibility and public API
Changelog
See the changelog.
Contributing
Send code contributions to this repository and documentation changes to arttecs/murmur-docs. See the contributing guide and code of conduct.
Security
Report vulnerabilities privately following the security policy.
License
Murmur is released under the MIT License.