# AnyCable

AnyCable is an open-source realtime server for reliable two-way communication over WebSockets and Server-Sent Events.

Canonical page: https://ourlocalhost.com/app/7915/anycable

## Description

AnyCable is an open-source realtime server for reliable two-way communication over WebSockets and Server-Sent Events. It provides built-in delivery guarantees, message ordering, and presence tracking, and keeps connections alive through deploys by replaying missed messages when clients reconnect. It integrates with Rails, Laravel, Node.js, Python/FastAPI, or any backend via HTTP API, and suits teams building realtime features who want a self-hosted alternative to managed services like Pusher or Ably.

## Platform availability

Available on 2 of 10 platforms: Windows, Any server.

## Desktop and other devices

Windows, Other (freebsd).

## Health score

77/100 (Good), based on 4 of 5 factors.
- Maintained: 100 (last commit 0 days ago)
- Popular: 68 (2,395 GitHub stars)
- Easy to install: 45 (3 install platforms, install notes)
- Security check: 76 (no serious findings, CI, tests, OpenSSF Scorecard 4.1/10)

## Links

- Official website: https://anycable.io
- GitHub: https://github.com/anycable/anycable
- desktop: https://github.com/anycable/anycable/releases/latest
- Documentation: https://github.com/anycable/docs.anycable.io

## Common questions

### How do I wire AnyCable into my Rails app?

Add the anycable-rails gem and run 'bin/rails g anycable:setup' — it's an interactive wizard that fills in the configuration for you. Skipping it means AnyCable won't be wired into your Rails app correctly.

### Why are my WebSocket connections rejected when using Rails?

Start anycable-go with --headers=cookie,origin (e.g. 'anycable-go --headers=cookie,origin --port=8080'). Forwarding those headers is required for Rails' forgery protection to work; without them, connections are rejected.

### How do I point anycable-go at my app backend and Redis?

Set options like --rpc_host, --redis_url, and --port when starting the server, e.g. 'anycable-go --rpc_host=localhost:50051 --redis_url=redis://localhost:6379/5 --host=localhost --port=8080'. If these don't match where your app and Redis actually run, live updates will fail. The same settings can also be set via environment variables like ANYCABLE_RPC_HOST or stored in a .toml file.

### Are there connection or message caps when self-hosting?

No — there are no caps on connections or messages when you self-host, and messages never leave your infrastructure, which is why healthcare teams run it for HIPAA-covered data.

### Is AnyCable a drop-in replacement for Action Cable in Rails?

Yes, AnyCable is a drop-in replacement for Action Cable, and users commonly switch when they need to scale beyond roughly 3k simultaneous connections, since built-in Action Cable holds up fine until about that point.

### How long does AnyCable keep message history for reconnecting clients?

Each stream keeps its recent history — 100 messages for 5 minutes by default, configurable — so a reconnecting client gets what it missed, in order.

## Alternatives

- Ably
- Action Cable
- Centrifugo: Centrifugo is an open-source, self-hosted real-time messaging server.
- Pusher Channels
- Supabase Realtime

---
Source: Our Local Host (https://ourlocalhost.com/app/7915/anycable), the self-hosted and open-source app directory.
