Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Crystal
  3. Cable

Cable

MITCrystalv0.4.0

A 100% ActionCable-compatible WebSocket server for real-time features in Crystal applications.

GitHubGitHub
137 stars12 forks0 contributors

What is Cable?

Cable is a WebSocket server library for the Crystal programming language that enables real-time, bidirectional communication between server and clients. It solves the problem of adding live features like chat, notifications, or updates to Crystal web applications by providing a server-side implementation fully compatible with the ActionCable JavaScript client.

Target Audience

Crystal developers building web applications that require real-time features, especially those transitioning from Ruby on Rails or seeking an ActionCable-like experience in Crystal.

Value Proposition

Developers choose Cable because it offers 100% compatibility with the widely-used ActionCable JS client, eliminating the need for custom client-side code, and provides a flexible, multi-backend architecture that integrates smoothly with existing Crystal web frameworks.

Overview

It's like ActionCable (100% compatible with JS Client), but you know, for Crystal

Use Cases

Best For

  • Adding real-time chat functionality to a Crystal web application
  • Implementing live notifications or activity feeds in Lucky framework projects
  • Building collaborative editing features with WebSockets in Crystal
  • Migrating a Rails application with ActionCable to Crystal while keeping the frontend unchanged
  • Creating real-time dashboards or monitoring tools with Crystal backend
  • Developing multiplayer game backends requiring persistent connections

Not Ideal For

  • Projects not using the Crystal programming language, as it's language-specific and lacks cross-platform support.
  • Teams requiring out-of-the-box production readiness for all backend options, since alternatives like NATS or Postgres may need additional work before deployment.
  • Applications needing non-ActionCable WebSocket protocols, due to its tight coupling with the ActionCable JavaScript client.
  • Environments with strict logging cost constraints, as default settings produce high-volume logs that require manual tuning to reduce overhead.

Pros & Cons

Pros

ActionCable JS Compatibility

Works 100% with the standard ActionCable JavaScript client, eliminating the need for custom frontend code, as highlighted in the README's seamless integration examples.

Flexible Backend Support

Supports multiple pub/sub backends including Redis, NATS, PostgreSQL, and AMQP, allowing developers to choose based on existing infrastructure, though some are experimental.

Framework Agnostic Design

Can be integrated with any Crystal web framework like Lucky or Kemal, providing versatility without locking users into a specific ecosystem.

Robust Connection Management

Offers identified connections and owned user instances, simplifying authentication and state handling, as demonstrated in the connection class with user token decoding.

Configurable Error Handling

Includes hooks for error reporting to third-party services like Bugsnag, enabling easy monitoring integration, as shown in the configuration examples.

Cons

Incomplete Backend Maturity

Alternate backends such as NATS, Postgres, and AMQP are flagged as potentially needing work before production use, limiting reliability for non-Redis setups.

Missing stream_for Feature

Lacks support for ActionCable's `stream_for` helper, requiring manual stream naming, which the README admits in the ChatChannel example.

High Logging Overhead

Default logging produces high volume, potentially increasing costs, and the README warns users to tune levels to 'warn' for critical logs only.

Complex Initial Setup

Requires detailed configuration including middleware placement, backend selection, and error handler setup, which can be daunting for new adopters.

Frequently Asked Questions

Quick Stats

Stars137
Forks12
Contributors0
Open Issues13
Last commit4 months ago
CreatedSince 2019

Tags

#realtime#hacktoberfest#redis#actioncable#crystal-lang#server#websocket#crystal#crystal-language#backend#lucky-framework#pub-sub#real-time#websockets

Built With

N
NATS
A
AMQP
P
PostgreSQL
C
Crystal
R
Redis

Included in

Crystal3.5k
Auto-fetched 8 hours ago

Related Projects

crestcrest

HTTP and REST client for Crystal

Stars250
Forks15
Last commit1 month ago
halitehalite

💎HTTP Requests Client with a chainable REST API, built-in sessions and middlewares.

Stars172
Forks13
Last commit4 years ago
crulcrul

Command line HTTP client written in Crystal

Stars113
Forks11
Last commit6 years ago
http2http2

HTTP/2 Protocol Implementation for the Crystal Language

Stars111
Forks11
Last commit22 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub