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 is secret now. See updated documentation ๐Ÿ‘€ to see how to set secret. Also changes opened a way for exporting Centrifugo node statistics via HTTP API stats 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 to centrifugo when starting process.
    • ๐Ÿšฆ when secret set via environment variable CENTRIFUGO_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 of application/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