Be notified of new releases
Create your free GitHub account today to subscribe to this repository for new releases and build software alongside 31 million developers.Sign up
This is a new major version of Centrifugo. New version has some important changes and useful features – read new documentation.
Centrifugo v2 serves the same purpose as Centrifugo v1. Centrifugo v2 is not backwards compatible with v1 – migration to it will require adapting both backend and frontend sides of your application (of course if you decide to migrate).
Centrifugo is now based on new library centrifuge for Go language. That library can be used standalone to get even more than Centrifugo server provides – like custom authentication, your own permission management, asynchronous message passing, RPC calls etc.
Highlights of v2:
- Cleaner and more structured client-server protocol defined in protobuf schema. Protocol is more compact because some fields with default values that were sent previously now omitted
- Binary Websocket support (Protobuf). Protobuf allows to transfer data in much more compact and performant way than before. Of course JSON is still the main serialization format
- JWT for authentication and private channel authorization instead of hand-crafted HMAC sign. This means that there is no need in extra libraries to generate connection and subscription tokens. There are plenty of JWT libraries for all languages
- Prometheus integration and automatic export of stats to Graphite. Now Centrifugo easily integrates in modern monitoring stack – no need to manually export stats
- Simplified HTTP API authentication (no request body signing anymore)
- GRPC for server API
presence_statsAPI command to get compact presence information - how many clients and unique users in channel
- Structured logging with colored output during development
- Mechanism to automatically merge several Websocket messages into one to reduce syscall amount thus be more performant under heavy load
- Better recovery algorithm to fix several
recoveredflag false positives
- Goreleaser for automatic releases to Github
Some things were removed from Centrifugo in v2 release:
- Publishing over Redis queue
- Admin websocket endpoint
- Client limited channels
- Channel option
- Websocket prepared message support (though this one can be pushed back at some point).
Documentation contains actual information and tips about migration from v1.
As mentioned above new version uses JWT tokens for authentication and private channel authorization. And there is no API request body signing anymore. This all means that using API clients (like
gocent before) is not necessary anymore – you can use any JWT library for your language and just send commands from your code – this is just simple JSON objects. Though API libraries still make sense to simplify integration a bit.
Currently the following clients work with v2:
- centrifuge-js – for browser, NodeJS and React Native.
- centrifuge-go - for Go language.
- centrifuge-mobile - for iOS and Android using
- centrifuge-dart – for Dart and Flutter. This lib is WIP and does not support all features yet.
At moment there are no native mobile clients. I.e.
centrifuge-android have not been updated to Centrifugo v2 yet.
docker pull centrifugo/centrifugo:v2.0.0
docker pull centrifugo/centrifugo:v2
docker pull centrifugo/centrifugo:v2.0
docker pull centrifugo/centrifugo:latest