georgeboot/laravel-echo-api-gateway
Connect Laravel Echo to AWS API Gateway WebSocket APIs. This package enables realtime broadcasting and channel subscriptions through API Gateway, so you can use serverless WebSockets without running a dedicated Echo server.
Architecture fit
This package sits at the seam between Laravel's broadcasting layer and AWS API Gateway's WebSocket API, with a laravel-echo client on the browser side. The 0.5.9 release confirms that architecture: the reconnect defect is explicitly tied to API Gateway's 2-hour maximum connection duration, which only matters if we are terminating WebSocket connections at API Gateway rather than at Reverb/Soketi/Pusher. Two implications for fit:
The dual laravel-echo v1 (^1.10) and v2 support is architecturally useful: it decouples our frontend framework upgrade from the realtime transport, which removes a common sequencing blocker in Laravel upgrade programs.
Integration feasibility Low-to-moderate effort, but not zero-touch, because half of this release is JavaScript rather than PHP.
0.5.9), no stated breaking changes or config migrations. Expect a routine composer update.Technical risk
| Risk | Severity | Notes |
|---|---|---|
| Security fix shipped in a patch version | High | "Closes a few security gaps in the websocket handler" implies 0.5.0–0.5.8 are exposed. No CVE or advisory referenced. We must assume exploitable until characterized. |
| Silent failure mode was the previous default | High (now mitigated) | Listeners stopping without error after 2h is the worst class of bug — no alerting signal, users just stop seeing updates. |
| Stale clients persist post-fix | Medium | Users on cached JS bundles remain broken indefinitely without cache-busting. |
| Pre-1.0 package, doubled compatibility matrix | Medium | Supporting Echo v1 and v2 means two code paths to test on every future release. |
| Unknown scope of "channel security" changes | Medium | Could range from origin validation to private/presence channel authorization bypass. Scope determines whether we need a disclosure review. |
Key questions
pusher-js version does it require, and does that conflict with anything already in our bundle?Stack fit
Assumes Laravel backend with the package's broadcast driver pointed at API Gateway's @connections management API, plus a JS client layered on laravel-echo. Before committing, confirm the package's supported Laravel and PHP version ranges against our current runtime, and confirm we are not concurrently running Reverb or a Pusher-compatible broadcaster for the same channels — running two realtime paths creates a split-brain channel authorization model that would compound the security concern in this release.
Migration path
^0.5.9 in composer.json and publish the updated JS client to our asset pipeline.Compatibility
^1.10) and v2 both supported — but pick one per environment rather than mixing, so failures are attributable.Sequencing Security-first: if the channel authorization gaps are exploitable pre-auth or cross-tenant, escalate to an out-of-band hotfix deploy rather than waiting for the normal release train. Reliability fix second. Echo v2 adoption can be deferred — it is an enablement feature, not a defect fix, and should be sequenced behind our own frontend framework upgrade rather than in front of it.
Maintenance
Dual Echo version support permanently doubles the client test matrix. Budget for it in CI: at minimum, a smoke test per Echo major on subscribe, reconnect, and private-channel authorization. Also expect the package to remain pre-1.0 for the near term; pinning exact minor versions and reviewing each release diff is the appropriate posture rather than floating on ^0.5.
Support Two new support vectors: (a) users on stale client bundles silently missing events — indistinguishable from the bug this release fixes, so support scripts must capture client bundle version first; (b) potential security disclosure handling if the channel gaps turn out to be externally reportable. Add a runbook entry to identify client version before diagnosing "not receiving updates."
Scaling The 2-hour connection ceiling at API Gateway is a hard platform constraint, not something the package removes — it only makes recovery graceful. Plan for a reconnect storm: when a large cohort of connections established at the same time hits the limit, they will all reconnect within a narrow window. Require jittered exponential backoff in the client, and confirm the package's new reconnect logic uses randomized delay. Also account for API Gateway's per-account connection rate quotas and the 10-minute idle timeout, which is a separate expiration path from the 2-hour cap and should be validated independently.
Failure modes
| Mode | Signal | Mitigation |
|---|---|---|
| Silent listener death (pre-0.5.9) | None — users simply stop seeing updates | Upgrade + heartbeat/echo-message health check with client-side detection |
| Reconnect storm after 2h boundary | Connection rate throttling, 429s | Jittered backoff, stagger connection establishment |
| Events dropped during reconnect | Users report gaps, no errors | Confirm replay semantics; consider sequence numbers or a fetch-on-reconnect reconciliation |
| Authorization token expiry across reconnect | Subscribe failures on private/presence channels | Verify the hardened handler still refreshes credentials rather than hard-failing |
| Stale client bundle | Version-skewed behavior across user base | Cache-busted assets, minimum-version enforcement on the server |
| Lambda cold start on connect | Elevated connect latency | Provisioned concurrency if connect path is latency-sensitive |
Ramp-up
Team needs working knowledge of three domains: Laravel broadcasting semantics (channels, private/presence authorization), AWS API Gateway WebSocket lifecycle (connect/disconnect/default routes, @connections post-to-connection, hard limits), and laravel-echo client configuration. The Echo v1→v2 boundary adds a fourth variable and is the most likely source of confused debugging. Recommend one engineer own the transport end-to-end for the first release cycle, and document the connection lifecycle with the specific 2-hour and 10-minute timers called out — this release demonstrates that the team's mental model previously did not include them.
Overall recommendation: Upgrade is warranted and should be prioritized as security-driven, contingent on answers to questions 1 and 2. The reliability fix is high-value but entirely client-side, so it delivers no benefit until the JS bundle reaches users — do not treat a backend deploy as closure.
How can I help you explore Laravel packages today?