Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Rfc6455 Laravel Package

ratchet/rfc6455

A framework-agnostic RFC6455 WebSocket protocol handler for PHP, with components for both server- and client-side handshake and messaging negotiation. It performs no I/O itself; HTTP upgrade integration is handled through PSR-7 interfaces, leaving implementation-specific interpretations open.

View on GitHub
Deep Wiki
Context7

I/O agnostic WebSocket Protocol

Frequently asked questions about Rfc6455
Is ratchet/rfc6455 a WebSocket server for Laravel?
No. ratchet/rfc6455 is an I/O-agnostic protocol library: it handles the RFC 6455 handshake, framing, message assembly, and permessage-deflate, but it deliberately performs no socket or HTTP I/O. You must supply an event loop and socket layer, such as ReactPHP react/socket or Amp, and run it as a long-running process. Laravel itself does not host the WebSocket connection.
Can I use ratchet/rfc6455 in a Laravel controller under PHP-FPM?
Not under PHP-FPM. Laravel's request/response lifecycle ends when the response is sent, so it cannot hold persistent WebSocket connections. The workable shape is two-tier: Laravel stays the system of record for auth, authorization, and persistence, while a separate event-loop process runs ratchet/rfc6455 and communicates with Laravel over an internal HTTP API, a queue, or Redis pub/sub. Treat it as a service to build, not a package you install and call from a controller.
How do I install ratchet/rfc6455 and what PHP version does it require?
Install it with Composer using composer require ratchet/rfc6455. Version 0.4.0 requires PHP 7.4 or newer and uses PSR-17 HTTP factory interfaces instead of Guzzle objects, so you also need a PSR-7/PSR-17 implementation such as nyholm/psr7. Because the library is pre-1.0, pin the version and review the changelog before upgrading.
Does ratchet/rfc6455 support Laravel 10 and Laravel 11?
ratchet/rfc6455 is framework-agnostic and has no Laravel service provider or config file, so Laravel version support is really a PHP compatibility question. Laravel 10 or 11 on PHP 8.1+ comfortably satisfies the PHP 7.4+ floor of 0.4.0. You integrate it by running a separate socket process alongside the Laravel app, not by adding a Laravel feature flag.
Which event loop should I use with ratchet/rfc6455, ReactPHP or Amp?
Either can work because the library owns no I/O, but ReactPHP react/socket is the most common pairing since the parent Ratchet project uses it. Amp is viable if your team already has Amp experience and an Amp-based supervisor. Whichever you choose, you must build the event loop, socket listener, process supervision, and shutdown/drain handling yourself.
How does the PSR-7 handshake work in ratchet/rfc6455?
You create a PSR-7 request from the HTTP upgrade and pass it to the server or client negotiator, using PSR-17 factories to build responses and streams. The negotiator returns the 101 Switching Protocols response or an error response, and after the upgrade you feed raw frames into MessageBuffer and read assembled messages out. You remain responsible for reading and writing bytes on the socket.
Does ratchet/rfc6455 support permessage-deflate compression?
Yes. The library implements permessage-deflate negotiation and frame compression as part of its RFC 6455 handling. You control whether to enable it during the handshake, and you should benchmark CPU and memory because compression costs apply per connection. If you need strict control over frame or compression policy, this is one of the reasons to choose this package over a higher-level server.
Should I use ratchet/rfc6455 or Laravel Reverb?
For most Laravel teams, Laravel Reverb or a managed WebSocket service is the better buy. Reverb is a first-party, higher-level server built on the same ReactPHP lineage, with Laravel 11+ integration and far less assembly work. Choose ratchet/rfc6455 only when you need protocol-level control: custom subprotocol negotiation, tight frame or compression policy, client-side handshake, or embedding in a non-ReactPHP event loop.
Is ratchet/rfc6455 production-ready and stable?
Treat it as pre-1.0 and pin it. It passes the Autobahn conformance suite, is MIT licensed, and has active maintenance through 0.4.0, but 0.4.0 changed the HTTP abstraction and raised the PHP floor, so breaking changes are expected. Adoption signals are thin, the release metadata has shown an anomalous future date, and there is no commercial support contract, so verify tag provenance and own the operational risk.
How do I authenticate Laravel users on a ratchet/rfc6455 socket server?
The package provides no authentication or session integration. A common pattern is for Laravel to issue short-lived signed tickets that the socket process validates locally, or to have the socket process call an internal Laravel endpoint during the handshake. Do not try to reuse the Laravel session cookie directly across processes; keep authorization rules in Laravel and cache only what the socket tier needs.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
roundly-consulting/kubernetes-api-for-laravel
roundly-consulting/plausible-for-laravel
gvp/gvp-laravel-template
metasyncsite/laravel-metasync-client
roundly-consulting/onboarding-for-laravel
andydefer/laravel-notification
adachsoft/cli-process-tester
jhaskell13/laraflow
sebastienheyd/boilerplate-media-manager
ccast/tagixo-primix
pretendtrue/laravel-builder
sawmainek/laravel-scout-tntsearch-driver
tomshaw/laravel-calendar-table
dibakar/laravel-ownership
steadrun/laravel-monitor
labyrinthe/connect-laravel
elmogy/layan
drewdan/sentinel-client
dskripchenko/laravel-llm
fatryst/nuonuo