Skip to content
cabby

Run it

Next to an app

Most setups run Cabby next to a web app. Cabby holds the WebSocket connections and calls your app over HTTP (RPC) when a client connects, subscribes or sends a message. Both share a secret:

cabby --rpc_host=http://localhost:3000/_anycable --secret=change-me --broadcast_adapter=http

By default Cabby listens on port 8080 and serves WebSockets at /cable. Change them with --port and --path.

Check that it's up

curl -i http://localhost:8080/health

A 200 response means Cabby is ready for connections.

Without an app

To try Cabby on its own, run it in standalone mode with public streams:

cabby --norpc --public --broadcast_adapter=http

--broadcast_adapter=http takes broadcasts over HTTP only. Without it, Cabby also looks for Redis on localhost:6379 and stops if it can't connect.

--public accepts every connection and subscription. Use it only for local experiments.

In this mode broadcasts go to port 8090:

curl -X POST http://localhost:8090/_broadcast -d '{"stream":"demo","data":"{\"text\":\"Hello\"}"}'

Environment variables

Almost every flag has an environment variable: --secret is ANYCABLE_SECRET, --port is ANYCABLE_PORT and so on. cabby --help lists them all. A flag on the command line wins over its environment variable. Configuration has the details.

Cabby 0.2.0 adds CABBY_* names for these; the ANYCABLE_* names will keep working.

Next: pick your framework, starting with Rails.