explaingit

centrifugal/centrifugo

10,265GoAudience · developerComplexity · 4/5Setup · moderate

TLDR

A self-hosted server that instantly pushes real-time messages to connected browsers and mobile apps the moment your backend publishes them, powering live chat, dashboards, notifications, and multiplayer features.

Mindmap

mindmap
  root((Centrifugo))
    What it does
      Real-time message server
      Publish-subscribe model
    Transport methods
      WebSocket
      Server-Sent Events
      gRPC
    Scaling
      Redis broker
      NATS broker
      Horizontal scaling
    Features
      Message history
      Online presence
      JWT authentication
      Admin web UI
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Add live chat to a web app by having your backend publish messages to Centrifugo channels and letting browsers subscribe via WebSocket

USE CASE 2

Build a dashboard that refreshes automatically when data changes without users having to reload the page

USE CASE 3

Scale a real-time feature to thousands of simultaneous connections by running multiple Centrifugo instances backed by Redis

USE CASE 4

Show who is currently online in a channel using Centrifugo built-in presence information without building your own tracking logic

Tech stack

GoWebSocketgRPCRedisNATSPrometheus

Getting it running

Difficulty · moderate Time to first run · 1h+

Requires configuring authentication (JWT or proxy to your backend) and optionally Redis or NATS for multi-instance deployments.

In plain English

Centrifugo is a self-hosted server that pushes real-time messages to users the moment something happens, without them having to ask. Think of it as the plumbing behind features like live chat, live comment feeds, multiplayer game state updates, or dashboards that refresh automatically. It sits between your application backend and your users, and when your backend publishes a message, Centrifugo instantly forwards it to everyone currently connected who subscribed to that topic. The server uses a publish-subscribe model: your backend sends a message to a named channel, and all connected clients who joined that channel receive it. Connections from browsers and mobile apps can use several different transport methods, including WebSocket, Server-Sent Events, and GRPC. This flexibility means you can pick the connection type that fits your platform best without rewriting the server logic. Because Centrifugo is language-agnostic, your backend can be Python, Ruby, PHP, Node.js, or anything else, as long as it can make an HTTP or GRPC call. For teams that need to handle a large number of simultaneous connections, Centrifugo can scale horizontally using Redis or Nats as a shared message broker between multiple server instances. It also keeps a short history of recent messages in each channel so that users who reconnect briefly after dropping off can catch up on what they missed. Online presence information (knowing who is currently connected to a channel) and join or leave notifications are also built in. Authentication is handled either through JWT tokens or by asking your own backend to approve each connection. An embedded admin web interface lets you inspect channels and connections. Prometheus metrics and an official Grafana dashboard are included for monitoring. The project positions itself as a self-hosted alternative to commercial real-time messaging services, intended to run once and stay running without ongoing configuration changes.

Copy-paste prompts

Prompt 1
Show me how to set up Centrifugo with Docker and connect a JavaScript browser client using WebSocket to subscribe to a channel and receive messages
Prompt 2
How do I publish a real-time notification from my Python backend to a specific Centrifugo channel when a database record changes?
Prompt 3
How does Centrifugo handle reconnection and message history so a user who briefly goes offline does not miss messages when they come back?
Prompt 4
Walk me through configuring Centrifugo JWT authentication so only logged-in users can subscribe to their personal notification channel
Open on GitHub → Explain another repo

← centrifugal on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.