ratchet/pawl
Async WebSocket client for PHP built on ReactPHP promises. Connect to ws/wss endpoints, negotiate subprotocols, send custom headers, and handle messages via event-driven callbacks. Includes Connector/WebSocket/Message APIs and Autobahn-tested compatibility.
This package enables real-time bidirectional communication features in PHP applications, supporting critical product decisions around building vs. buying real-time capabilities. It allows teams to avoid third-party WebSocket services (like Pusher) for internal or controlled use cases, reducing costs and increasing data control. For roadmaps requiring live updates, chat systems, or IoT device communication, Pawl provides a lightweight, open-source solution that integrates natively with ReactPHP's event loop. It validates the "build" approach for custom WebSocket clients where existing PHP frameworks lack native client-side support, while avoiding reinventing the wheel for low-level WebSocket handling.
Adopt this package when building server-side PHP applications that need to act as WebSocket clients (e.g., connecting to external services like stock tickers or IoT hubs), especially in ReactPHP-based systems. It's ideal for async, non-blocking communication where traditional HTTP clients fail, and when you require PSR-7 compatibility, subprotocol negotiation, or fine-grained connection control. Avoid it for browser-based clients (use native JS WebSocket), server-side implementations (use Ratchet instead), or synchronous PHP environments without an event loop. Also skip if your use case only requires simple HTTP polling or if you need enterprise support (this is community-maintained).
Executives: "Pawl lets us build real-time features like live notifications and data streams directly in our PHP infrastructure—without expensive third-party services. It’s a proven, open-source solution with 600+ stars and regular updates, reducing costs while keeping full control of our data flow. This enables faster innovation for customer-facing real-time features without vendor lock-in."
Engineering: "Pawl provides a battle-tested, async WebSocket client that integrates seamlessly with ReactPHP and PSR-7. It handles complex scenarios like binary messages, subprotocols, and connection management with minimal boilerplate—passing all Autobahn testsuite checks. Recent updates support PHP 8.4 and modern dependencies, making it a reliable, lightweight choice for server-side WebSocket
How can I help you explore Laravel packages today?