Introduction
Surge is a lightweight, self-hosted, Pusher-compatible realtime broadcasting server for Laravel. It speaks the Pusher WebSocket protocol, so it drops straight into an app that already uses Laravel broadcasting and Laravel Echo — you change the host and port in your config and your existing private/presence channels, events, and client events keep working, now on infrastructure you own.
The core has zero required dependencies: the WebSocket layer, the Pusher protocol, the HTTP trigger API, and even the Redis scaling client are written against PHP's standard library.
Why it exists
Hosted realtime (Pusher) is easy but metered and third-party. Self-hosted options exist, but Surge aims for a specific combination:
- Drop-in. Keep Laravel Echo, keep your channels, keep your
broadcast()calls — just repoint them. - Light. The default lite runtime is one pure-PHP process. Nothing to compile, runs anywhere PHP runs.
- Honest. It fails closed on malformed input and never claims a capability it doesn't have.
What's real today
Surge is young. Here is the current, honest status:
stable RFC 6455 WebSocket server · lite (pure-PHP) runtime
stable Pusher protocol — public / private / presence channels, client events, ping/pong
stable Pusher HTTP trigger API with REST signature verification
stable Laravel package (service provider, config, surge:serve)
stable Redis pub/sub event relay across nodes
experimental Multi-core turbo runtime (OpenSwoole) — not yet load-tested
Honest caveats
- The pure-PHP lite runtime is single-process (one core). It is light, not the fastest. The multi-core turbo runtime is included but experimental.
- Cross-node presence is eventually consistent — joins/leaves propagate and rosters converge over one relay round-trip. See scaling.
- There is no TLS termination built in — run Surge behind a TLS-terminating proxy. See Deployment.