centrifugo README

The project's README from github.com/centrifugal/centrifugo. As one markdown file: README.md.

Centrifugo

Scalable real-time messaging server in a language-agnostic way.

CI Release Docker Pulls License Telegram Discord

Centrifugo is an open-source scalable real-time messaging server. It instantly delivers messages to application online users connected over supported transports (WebSocket, HTTP-streaming, Server-Sent Events (aka EventSource), GRPC, WebTransport). Centrifugo has the concept of channel subscriptions – so it's a user-facing PUB/SUB server.

Centrifugo is language-agnostic and can be used to build chat apps, live comments, multiplayer games, real-time data visualizations, collaborative tools, AI streaming responses, etc. in combination with any backend. It is well suited for modern architectures and allows decoupling the business logic from the real-time transport layer.

The core idea of Centrifugo is simple – it's a PUB/SUB server on top of modern real-time transports:

Centrifugo PUB/SUB diagram

Your backend communicates with Centrifugo over a simple HTTP or GRPC API to publish messages into channels, while clients subscribe to those channels using one of the official SDKs (or the unidirectional approach with no SDK dependency).

Quick start

Spin up Centrifugo with its embedded admin UI using Docker:

docker run -it --rm -p 8000:8000 centrifugo/centrifugo:latest centrifugo \
  --client.insecure --admin.enabled --admin.insecure
# ^ insecure flags: for local trial only, never use in production

Then open http://localhost:8000 to reach the admin UI, where you can watch live connections and publish messages into channels. The insecure flags above remove authentication for a frictionless local trial only – never use them in production.

For native binaries, Homebrew, packages, and production configuration see the installation instructions, and follow the quickstart tutorial to connect your first client.

Why Centrifugo

The hard part is to make the PUB/SUB concept production-ready, efficient, flexible and available from different application environments. Centrifugo is a mature solution that already helped many projects with adding real-time features and scaling towards many concurrent connections. It provides a set of features not available in other open-source solutions in the area:

Client SDKs

Official SDKs wrap Centrifugo's bidirectional protocol and handle reconnects, subscription state, message recovery, and more across platforms:

Platform / Language SDK
JavaScript (browser, Node.js, React Native) centrifuge-js
Dart / Flutter (mobile and web) centrifuge-dart
Swift / native iOS centrifuge-swift
Java (Android, JVM) centrifuge-java
Python (asyncio) centrifuge-python
Go centrifuge-go
.NET / MAUI / Unity [WIP] centrifuge-csharp

For simple use cases Centrifugo also supports a unidirectional approach (WebSocket, SSE, HTTP-streaming, GRPC) that needs no SDK – any standard client for the transport works. See the transports overview and the client protocol spec for details.

Documentation

Community

Found a bug or have an idea? Open an issue. Want to contribute? See CONTRIBUTING.md.

Backing

This repository is hosted by packagecloud.io.

Private NPM registry and Maven, RPM, DEB, PyPi and RubyGem Repository · packagecloud

Also thanks to JetBrains for supporting OSS (most of the code here written in Goland):

JetBrains logo

centrifugo (centrifugal/centrifugo)

Searching Database…

What is this?Centrifugo is an open-source, language-agnostic real-time messaging server that lets any backend push messages to connected clients over WebSocket, HTTP-streaming, SSE, GRPC or WebTransport. It acts as a self-hosted alternative to Pubnub, Pusher, Ably, Socket.IO, Phoenix.PubSub and SignalR.
Is it a library I import or a standalone server?It is a standalone server you run yourself (via Docker, native binary, or Homebrew). Your backend talks to it over a simple HTTP or GRPC API to publish messages, while clients subscribe to channels using official SDKs.
How do I get it running?Spin it up with the embedded admin UI using Docker to try it locally, then open the admin UI in the browser to watch connections and publish test messages. For production, use native binaries, Homebrew, or packages with real configuration, following the quickstart tutorial.
Do I need Redis or anything else to run it?A single node can run standalone, but scaling across multiple nodes requires a broker: Redis (or Redis Cluster/compatible stores like Elasticache, Valkey, KeyDB, DragonflyDB), PostgreSQL, or Nats.
Any gotcha when trying the Docker quick start?The quick-start flags shown in the README disable client and admin authentication entirely for a frictionless local demo — you must never run with those insecure flags in production.
Do I need to write my backend in Go to use it?No. Centrifugo is language-agnostic — any backend stack can talk to it through its HTTP or GRPC API, and it's used to build chat apps, live comments, multiplayer games, real-time dashboards and AI streaming responses.
What transports do client SDKs support?WebSocket, HTTP-streaming, Server-Sent Events (EventSource), GRPC, and an experimental WebTransport transport.
Can I connect without installing an SDK?Yes, Centrifugo supports a unidirectional approach over WebSocket, SSE, HTTP-streaming or GRPC that needs no SDK — any standard client for that transport works.
How does Centrifugo authenticate connections?It supports JWT-based authentication or a proxy-like mode where Centrifugo makes a request to your backend to validate each connection.
What monitoring tools does it integrate with?It exposes a large set of Prometheus metrics and ships an official Grafana dashboard, plus a built-in admin web UI for watching live connections and publishing messages.
Size
168.1 MB
Stars
10.9K
Age
11y
Commits · 90 Days