Does Hatchbox support AnyCable?

AnyCable is a high-performance drop-in replacement for ActionCable

Written by Chris Oliver
Updated over a week ago
You can add AnyCable to your application by adding Processes to your app for the gRPC and websocket servers.

Environment Variables
First, we'll want to set some environment variables to configure AnyCable.
ACTION_CABLE_ADAPTER=any_cable
ANYCABLE_DEBUG=1
ANYCABLE_HEALTH_URL=http://localhost:8079/health
ANYCABLE_HOST=localhost
ANYCABLE_LOG_LEVEL=debug
ANYCABLE_PATH=/
ANYCABLE_PORT=8079
ANYCABLE_REDIS_CHANNEL=__anycable__
ANYCABLE_RPC_HOST=localhost:50052
CABLE_URL=ws//localhost:8079
Processes
Visit the Process tab of your App and add the processes there. They will be added a systemd services that will be monitored and restarted automatically in case of a crash.

Caddy Routes
You'll also need to tell Caddy to forward websocket requests to the AnyCable process. You can modify the Caddy routes for your app to look like the following. This will proxy websocket requests to the process on localhost:8079.

Was this article helpful?