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

Websocket Laravel Package

phrity/websocket

WebSocket client and multi-connection server for PHP, supporting ws/wss, listener callbacks, close and ping/pong handling, optional deflate compression, message fragmentation, and custom opcodes.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Real-time features: Enables low-latency, bidirectional communication for chat apps, live notifications, or collaborative tools (e.g., Google Docs-like editing).
  • Build vs. buy: Avoids reinventing WebSocket infrastructure; leverages a battle-tested, actively maintained PHP package instead of custom Node.js/Python solutions.
  • Roadmap alignment (v4 now GA): The v4 line is now released, delivering the previously promised exception restructuring, removal of deprecated code, and a leaner dependency on Nyholm PSR HTTP. Teams on v3.x should schedule migration rather than defer, since v4 has landed ahead of the earlier "roadmap" framing.
  • Migration budgeting: v4 is a major, breaking release—plan engineering effort for the v3→v4 upgrade (Client/Server configuration changes, getConnections() now returning a Connections collection instead of an array, and use of Nyholm PSR HTTP directly rather than internal stub classes). Treat this as a scoped upgrade project, not a routine patch bump.
  • Use cases:
    • Client-side: Integrate with third-party WebSocket APIs (e.g., stock tickers, IoT dashboards).
    • Server-side: Build scalable real-time backends (e.g., multiplayer games, live analytics).
    • Hybrid: Combine with Laravel Echo/Pusher for fallback logic or custom protocols.

When to Consider This Package

  • Adopt if:

    • Your PHP stack (Laravel/Symfony) needs native WebSocket support without external services (e.g., Pusher, Ably).
    • You require custom middleware (e.g., compression, authentication, or protocol extensions).
    • Your team has PHP expertise and can maintain WebSocket logic in-house.
    • You need multi-connection handling (e.g., game lobbies, broadcast systems).
    • You are starting fresh: adopt v4 directly and avoid inheriting v3 migration debt.
  • Look elsewhere if:

    • You’re using JavaScript-heavy stacks (e.g., Node.js with Socket.io) where PHP interop isn’t critical.
    • Your use case is simple pub/sub (consider Laravel’s built-in broadcasting with Redis).
    • You lack DevOps resources to manage persistent WebSocket servers (e.g., load balancing, SSL termination).
    • You need enterprise-grade SLA (e.g., 99.99% uptime); opt for managed services like Pusher or AWS API Gateway WebSockets.
    • You cannot absorb a breaking major-version upgrade in the near term and are already running v3.x in production with tight release windows—defer adoption until you can schedule the migration.

How to Pitch It (Stakeholders)

For Executives: "This package lets us own our real-time infrastructure in PHP, reducing vendor lock-in and costs. For example, we can replace Pusher’s $500/month for 10K connections with a self-hosted Laravel server using this library—saving ~$60K/year while gaining full control. The team has now shipped v4 (the major release we were tracking), which cleans up legacy code and modernizes HTTP handling. We should budget a short, scoped upgrade sprint to move off v3.x, since v4 includes breaking interface changes—planning ahead avoids an emergency migration later."

For Engineering: *"v4.0.0 has shipped and is a major release with breaking changes. Highlights:

  • Improved exception structure (new exception classes; catch logic will need review).
  • MessageEncodingException surfaced on compression failure.
  • Removed deprecated code and deeper-level deprecated interfaces.
  • Nyholm PSR HTTP used directly—internal stub classes removed; anything relying on those stubs must migrate.
  • getConnections() now returns a Connections collection instead of an array (type change cascades into your callers).
  • Client/Server configuration changes are the most likely v3→v4 conflicts per the maintainer.

Trade-offs:

  • Requires PHP expertise (no JS devs needed).
  • Self-hosted = more ops overhead (but cheaper at scale).
  • v4 migration carries real effort (exception handling, connection collections, configuration), so don't treat it as a patch upgrade.

Next steps:

  1. Assess: Read the v3→v4 migration guide and inventory current usage of getConnections(), exception handling, and any internal PSR HTTP stubs.
  2. Spike: Benchmark against Pusher/Ably for our top use case (e.g., chat latency).
  3. Pilot: Upgrade a single service to v4 (e.g., notifications) and validate behavior in staging.
  4. Scale: Migrate remaining real-time features and reassess TCO once v4 is stable in production."*
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.
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table
siberfx/flysystem-wasabi
hollyit/token-replace
ippanelcom/laravel-sdk
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel