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 (SSE), GRPC, WebTransport). Centrifugo is built around 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.
Official client SDKs are available for JavaScript (browser, Node.js, React Native), Dart/Flutter, Swift, Java, Python, Go, and .NET. In addition, Centrifugo supports a unidirectional approach for simple use cases with no SDK dependency.
For details, go to the Centrifugo documentation site. For runnable demos see centrifugal/examples.
What's changed
Fixes
- Centrifugo now bounds the size of a WebSocket message after
permessage-deflatedecompression, see #1162.websocket.message_size_limitalone only bounded the compressed bytes received on the wire, so without an additional limit a small compressed frame could be decompressed into a much larger amount of memory (a "decompression bomb" attack). By default, the limit is derived frommessage_size_limitmultiplied by the default multiplier (10); messages exceeding it cause Centrifugo to close the connection with amessage too bigclose code.
Two new optionswebsocket.decompressed_message_size_limitanduni_websocket.decompressed_message_size_limitallow tuning this limit if needed. Only effective when compression is enabled. Reported by @alanturing881 via GHSA-q6mr-3g59-5m8x.
Miscellaneous
- New blog post Scaling Redis Pub/Sub to Millions of Channels and Hundreds of Subscriber Nodes which shares the experience of working with Redis Pub/Sub in Centrifugo.
- PostgreSQL broker metrics were split into per-kind
broker_*/map_broker_*subsystems and renamed with apostgres_prefix to align with the rest of the broker metric conventions, see #1161. Previously stream and map PG brokers shared apg_broker_*subsystem and were told apart by abrokerlabel, so brokers with the same (or default) name collided. This is a breaking change (but PostgreSQL is still experimental so we decided to change it) for dashboards and alerts in deployments using the PostgreSQL broker – thebrokerlabel is nowbroker_name, and metric names changed as follows:pg_broker_cleanup_rows_deleted_total→broker_postgres_cleanup_removed_total,pg_broker_outbox_cursor_lag_seconds→broker_postgres_outbox_cursor_lag_seconds/map_broker_postgres_outbox_cursor_lag_seconds,pg_broker_partitions→broker_postgres_partitions/map_broker_postgres_partitions. See exposed metrics for the full list. - This release is built with Go 1.26.4
- Dependency updates
- See also the corresponding Centrifugo PRO release.