Centrifugo v1.0.0 Release Notes
-
๐ A bad and a good news here. Let's start with a good one. Centrifugo is still real-time messaging server and just got v1.0 release. The bad โ it is not fully backwards compatible with previous versions. Actually there are three changes that ruin compatibility. If you don't use web interface and private channels then there is only one change. But it affects all stack - Centrifugo itself, client library and API library.
๐ Starting from this release Centrifugo won't support multiple registered projects. It will work with only one application. You don't need to use
project key
anymore. Changes resulted in simplified ๐ configuration file format. The only required option issecret
now. See updated documentation ๐ to see how to setsecret
. Also changes opened a way for exporting Centrifugo node statistics via HTTP APIstats
command.๐ As this is v1 release we'll try to be more careful about backwards compatibility in future. But as we are trying to make a good software required changes will be done if needed.
๐ Highlights of this release are:
- ๐ง Centrifugo now works with single project only. No more
project key
.secret
the only required configuration option. - ๐ web interface is now embedded, this means that when downloading release you get possibility to run Centrifugo web interface just providing
--web
flag tocentrifugo
when starting process. - ๐ฆ when
secret
set via environment variableCENTRIFUGO_SECRET
then configuration file is not required anymore. But note, that when Centrifugo configured via environment variables it's not possible to reload configuration sending HUP signal to process. - ๐ new
stats
command added to export various node stats and metrics via HTTP API call. Look its response example in docs chapter. - ๐ new
insecure_api
option to turn on insecure HTTP API mode. Read more in docs chapter. - โก๏ธ minor clean-ups in client protocol. But as protocol incapsulated in javascript client library you only need to update centrifuge-js.
- ๐ release built using Go 1.5.1
๐ Documentation was updated to fit all these release notes. Also all API and client libraries were updated โ Javascript browser client (
centrifuge-js
), Python API client (cent
), Django helper module (adjacent
). API clients for Ruby (centrifuge-ruby
) and PHP (phpcent
) too. Admin web interface was also updated to support changes introduced here.There are 2 new API libraries: gocent and jscent. First for Go language. And second for NodeJS.
๐ป Also if you are interested take a look at centrifuge-go โ experimental Centrifugo client for Go language. It allows to connect to Centrifugo from non-browser environment. Also it can be used as a reference to make a client in another language (still hoping that clients in Java/Objective-C/Swift to use from Android/IOS applications appear one day โ but we need community help here).
How to migrate
- ๐ป Use new versions of Centrifugal libraries - browser client and API client. Project key not needed in client connection parameters, in client token generation, in HTTP API client initialization.
- ๐ Another backwards incompatible change related to private channel subscriptions. Actually this is not related to Centrifugo but to Javascript client but it's better to write about it here. Centrifuge-js now sends JSON (
application/json
) request instead ofapplication/x-www-form-urlencoded
when client wants to subscribe on private channel. See in docs how to deal with JSON in this case. - ๐
--web
is now a boolean flag. Previously it was used to set path to admin web interface. Now it indicates whether or not Centrifugo must serve web interface. To provide path to custom web application directory use--web_path
string option.
๐ I.e. before v1 you started Centrifugo like this to use web interface:
centrifugo --config=config.json --web=/path/to/web/app
Now all you need to do is run:
centrifugo --config=config.json --web
๐ And no need to download web interface repository at all! Just run command above and check http://localhost:8000.
๐ If you don't want to use embedded web interface you can still specify path to your own web interface directory:
centrifugo --config=config.json --web --web_path=/path/to/web/app
- ๐ง Centrifugo now works with single project only. No more