phrity/websocket
PHP WebSocket client and multi-connection server with ws/wss support. Includes listener callbacks, standard Close and Ping/Pong handling, optional deflate compression, fragmentation and masking support, plus middleware system for extending behavior.
textalk/websocket and aligns with Laravel’s dependency injection and event-driven patterns.laravel-websockets or custom implementations).CloseHandler, PingResponder, DeflateCompression) aligns with Laravel’s middleware stack, enabling consistent error handling and protocol extensions.WebSocket\Server::onText() → Laravel events).wss:// (handled via Laravel’s config/websockets.php or environment variables).~3.7.Log facade for consistency.beyondcode/laravel-websockets or extend Laravel’s HTTP kernel for WebSocket routes.nyholm/psr-http-message (already used in Laravel).phrity/net-stream (low-level, no direct Laravel impact).php artisan websocket:start to launch the server.Route::websocket() (custom macro) to map WebSocket endpoints.phrity/websocket.php artisan serve --port=6001).config/websockets.php for SSL/port settings.psr/log v2).phrity/websocket for breaking changes (v4 transition).Log facade (e.g., WebSocket\Server → Log::debug()).composer.json to avoid surprises.ReconnectException).Laravel\Queue).WebSocket\Server::onError() to log connection issues.laravel-websockets pattern).pcntl_fork for high concurrency).Server::setMaxConnections() to avoid overload.| Failure | Impact | Mitigation |
|---|---|---|
| WebSocket Disconnection | Lost real-time updates | Implement reconnection logic (ReconnectException). |
| Server Crash | Downtime for all WebSocket users | Use Laravel Forge/Envoyer for auto-restart. |
| SSL/TLS Issues | Connection failures | Validate certificates via Laravel’s config/ssl. |
| High Latency | Poor user experience | Optimize middleware (e.g., disable compression if slow). |
| Memory Leaks | Server instability | Monitor with Laravel Debugbar or Blackfire. |
onOpen, onClose events).up command.php artisan tinker to test WebSocket clients interactively.How can I help you explore Laravel packages today?