Scalable real-time messaging server in language-agnostic way

Join the chat at https://t.me/joinchat/ABFVWBE0AhkyyhREoaboXQ   Join the chat at https://discord.gg/tYgADKx

Centrifugo is a scalable real-time messaging server in language-agnostic way. Centrifugo works in conjunction with application backend written in any programming language. It runs as separate service and keeps persistent Websocket or SockJS connections from application clients (from web browsers or other environments like iOS/Android apps). When you need to deliver an event to your clients in real-time you publish it to Centrifugo API and Centrifugo then broadcasts event to all connected clients interested in this event (i.e. clients subscribed on event channel). In other words – this is a user-facing PUB/SUB server.

For more information follow to Centrifugo documentation site.

scheme

You can also find the following posts interesting:

How to install

See installation instructions in Centrifugo documentation.

Demo

Try our demo instance on Heroku (admin password is password, token_hmac_secret_key is secret, API key is api_key). Or deploy your own Centrifugo instance in one click:

Deploy

Highlights

  • Centrifugo is fast and capable to scale to millions of simultaneous connections
  • Simple integration with any application – works as separate service
  • Simple server API (HTTP or GRPC)
  • Client-side libraries for popular frontend environments
  • JSON and binary Protobuf Websocket client protocol based on strict schema
  • SockJS polyfill for web browsers without Websocket support
  • User authentication with JWT or over connection request proxy to configured HTTP endpoint
  • Proper connection management and expiration control
  • Various types of channels: private, user-limited
  • Various types of subscriptions: client-side or server-side
  • Transform RPC calls over WebSocket/SockJS to configured HTTP endpoint call
  • Presence information for channels (show all active clients in channel)
  • History information for channels (last messages published into channel)
  • Join/leave events for channels (client goes online/offline)
  • Automatic recovery of missed messages between client reconnects over configured retention period
  • Built-in administrative web panel
  • Cross platform – works on Linux, MacOS and Windows
  • Ready to deploy (Docker, RPM/DEB packages, automatic Let's Encrypt TLS certificates, Prometheus/Graphite monitoring)
  • MIT license
Owner
Centrifugal
Real-time messaging server and its friends
Centrifugal
Comments
  • can Server API have

    can Server API have "subscribe" command?

    I just read the document again, find there only has "unsubscribe" Server API command for backend server control user subscription.

    why no "subscribe" command in centrifugo Server API?

    the client can be fully passive. make the three roles: backend server, centrifugo, client keeping sync subscription is inefficient.

    I think the simplest client would be only need connect to centrifugo, then wait new message coming.

  • Infinity reconnect loop

    Infinity reconnect loop

    Everyday we have issue with random clients that catched in reconnect loop. After refresh page issue will temporary solve until next period. We enabled debug on client side and debug log on server side. But messages not so informative.

    Centrifugo server version: Centrifugo v1.5.1 (Go version: go1.6.2)

    Centrifuog-js version: 1.3.7

    How we subscribe to event on client side (part of source code):

    $rootScope.centrifuge = new Centrifuge({
                url: CrmSettings.centrifugoUrl + '/connection/websocket',
                user: CrmSettings.centrifugo_token.userId.toString(),
                timestamp: CrmSettings.centrifugo_token.timestamp.toString(),
                token: CrmSettings.centrifugo_token.token
            });
            $rootScope.centrifuge.connect();
            $rootScope.centrifuge.on('connect', function () {
                $rootScope.subscription = {};
                $rootScope.subscription['system-events'] = $rootScope.centrifuge.subscribe($rootScope.buildCentrifugoEventName('system-events'), function (message) {
                    $rootScope.handleSystemEvent(message.data);
                });
    
               });
    

    Centrifugo config.json:

    {
      "secret": "REMOVED",
      "web_password": "REMOVED",
      "web_secret": "REMOVED",
      "join_leave": true,
      "anonymous": true,
      "publish": true,
      "watch": true,
      "presence": true,
      "history_size": 999999,
      "history_lifetime": 1800,
      "recover": true,
      "history_drop_inactive": true
    }
    
    

    Server side log in debug level:

    [I]: 2016/11/14 10:40:12 GET /connection/websocket from 178.213.225.4:51657 completed in 1.41373094s
    [I]: 2016/11/14 10:40:13 New raw Websocket session established with uid a496a142-2f99-42ff-87f3-532c674df1f9
    [E]: 2016/11/14 10:40:14 client is closed
    [E]: 2016/11/14 10:40:14 client is closed
    [E]: 2016/11/14 10:40:14 client is closed
    [E]: 2016/11/14 10:40:14 client is closed
    [E]: 2016/11/14 10:40:14 client is closed
    [E]: 2016/11/14 10:40:14 client is closed
    [E]: 2016/11/14 10:40:14 client is closed
    [E]: 2016/11/14 10:40:14 client is closed
    [E]: 2016/11/14 10:40:14 client is closed
    [E]: 2016/11/14 10:40:14 client is closed
    [E]: 2016/11/14 10:40:14 client is closed
    [E]: 2016/11/14 10:40:14 client is closed
    [E]: 2016/11/14 10:40:14 client is closed
    [E]: 2016/11/14 10:40:14 client is closed
    [I]: 2016/11/14 10:40:14 GET /connection/websocket from 178.213.225.4:61754 completed in 22m32.814076042s
    [I]: 2016/11/14 10:40:14 error sending to b07621ca-4365-4b1f-abce-a222c6c899bc write tcp 185.5.249.166:8000->178.213.225.4:61754: use of closed network connection
    [E]: 2016/11/14 10:40:14 client is closed
    [E]: 2016/11/14 10:40:14 client is closed
    [E]: 2016/11/14 10:40:14 client is closed
    [E]: 2016/11/14 10:40:14 client is closed
    [E]: 2016/11/14 10:40:14 client is closed
    [E]: 2016/11/14 10:40:14 client is closed
    [E]: 2016/11/14 10:40:14 client is closed
    [E]: 2016/11/14 10:40:14 client is closed
    [E]: 2016/11/14 10:40:14 client is closed
    [E]: 2016/11/14 10:40:14 client is closed
    [E]: 2016/11/14 10:40:14 client is closed
    [E]: 2016/11/14 10:40:14 client is closed
    [E]: 2016/11/14 10:40:14 client is closed
    [E]: 2016/11/14 10:40:14 client is closed
    [E]: 2016/11/14 10:40:14 client is closed
    [E]: 2016/11/14 10:40:14 client is closed
    [I]: 2016/11/14 10:40:14 GET /connection/websocket from 178.213.225.4:51658 completed in 1.376436224s
    [I]: 2016/11/14 10:40:15 New raw Websocket session established with uid 02bcacdf-139d-471d-8ac5-28f90d61167e
    [I]: 2016/11/14 10:40:16 New raw Websocket session established with uid 785f8a4d-13c9-40b3-a358-9852b24f6936
    

    Client side log when start reconnect loop:

    9caf500….js:2109 no last uid found for channel production.multiple-user-mode--clientsh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.multiple-user-mode--servicesh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--clients.clientsh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--clients.tasksh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.sync--services.clientsh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.sync--services.visitsh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--services.tasksh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--services.occupancyh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.sync--services.occupancy-per-weekh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--services.workloadh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.updated--services.staffsh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--sales.saleh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--sales.sale-historyh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.system-eventsh @ 9caf500….js:2109
    9caf500….js:2109 Send Array[16]h @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 disconnected: slow trueh @ 9caf500….js:2109
    9caf500….js:2109 Status connected -> disconnectedh @ 9caf500….js:2109
    9caf500….js:2109 reconnect after 1454 millisecondsh @ 9caf500….js:2109
    9caf500….js:2109 start connectingh @ 9caf500….js:2109
    9caf500….js:2109 Status disconnected -> connectingh @ 9caf500….js:2109
    9caf500….js:2109 reset retries count to 0h @ 9caf500….js:2109
    9caf500….js:2109 Send Array[1]h @ 9caf500….js:2109
    9caf500….js:2109 Received Array[1]h @ 9caf500….js:2109
    9caf500….js:2109 Status connecting -> connectedh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.mango-api-notification_13h @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.mango-api-notification_23h @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.multiple-user-mode--clientsh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.multiple-user-mode--servicesh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--clients.clientsh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--clients.tasksh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.sync--services.clientsh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.sync--services.visitsh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--services.tasksh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--services.occupancyh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.sync--services.occupancy-per-weekh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--services.workloadh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.updated--services.staffsh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--sales.saleh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--sales.sale-historyh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.system-eventsh @ 9caf500….js:2109
    9caf500….js:2109 Send Array[16]h @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 disconnected: slow trueh @ 9caf500….js:2109
    9caf500….js:2109 Status connected -> disconnectedh @ 9caf500….js:2109
    9caf500….js:2109 reconnect after 1429 millisecondsh @ 9caf500….js:2109
    9caf500….js:2109 start connectingh @ 9caf500….js:2109
    9caf500….js:2109 Status disconnected -> connectingh @ 9caf500….js:2109
    9caf500….js:2109 reset retries count to 0h @ 9caf500….js:2109
    9caf500….js:2109 Send Array[1]h @ 9caf500….js:2109
    9caf500….js:2109 Received Array[1]h @ 9caf500….js:2109
    9caf500….js:2109 Status connecting -> connectedh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.mango-api-notification_13h @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.mango-api-notification_23h @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.multiple-user-mode--clientsh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.multiple-user-mode--servicesh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--clients.clientsh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--clients.tasksh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.sync--services.clientsh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.sync--services.visitsh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--services.tasksh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--services.occupancyh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.sync--services.occupancy-per-weekh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--services.workloadh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.updated--services.staffsh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--sales.saleh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--sales.sale-historyh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.system-eventsh @ 9caf500….js:2109
    9caf500….js:2109 Send Array[16]h @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 disconnected: slow trueh @ 9caf500….js:2109
    9caf500….js:2109 Status connected -> disconnectedh @ 9caf500….js:2109
    9caf500….js:2109 reconnect after 1443 millisecondsh @ 9caf500….js:2109
    9caf500….js:2109 start connectingh @ 9caf500….js:2109
    9caf500….js:2109 Status disconnected -> connectingh @ 9caf500….js:2109
    9caf500….js:2109 reset retries count to 0h @ 9caf500….js:2109
    9caf500….js:2109 Send Array[1]h @ 9caf500….js:2109
    9caf500….js:2109 Received Array[1]h @ 9caf500….js:2109
    9caf500….js:2109 Status connecting -> connectedh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.mango-api-notification_13h @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.mango-api-notification_23h @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.multiple-user-mode--clientsh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.multiple-user-mode--servicesh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--clients.clientsh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--clients.tasksh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.sync--services.clientsh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.sync--services.visitsh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--services.tasksh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--services.occupancyh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.sync--services.occupancy-per-weekh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--services.workloadh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.updated--services.staffsh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--sales.saleh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--sales.sale-historyh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.system-eventsh @ 9caf500….js:2109
    9caf500….js:2109 Send Array[16]h @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 disconnected: slow trueh @ 9caf500….js:2109
    9caf500….js:2109 Status connected -> disconnectedh @ 9caf500….js:2109
    9caf500….js:2109 reconnect after 1966 millisecondsh @ 9caf500….js:2109
    9caf500….js:2109 start connectingh @ 9caf500….js:2109
    9caf500….js:2109 Status disconnected -> connectingh @ 9caf500….js:2109
    9caf500….js:2109 reset retries count to 0h @ 9caf500….js:2109
    9caf500….js:2109 Send Array[1]h @ 9caf500….js:2109
    9caf500….js:2109 Received Array[1]h @ 9caf500….js:2109
    9caf500….js:2109 Status connecting -> connectedh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.mango-api-notification_13h @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.mango-api-notification_23h @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.multiple-user-mode--clientsh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.multiple-user-mode--servicesh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--clients.clientsh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--clients.tasksh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.sync--services.clientsh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.sync--services.visitsh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--services.tasksh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--services.occupancyh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.sync--services.occupancy-per-weekh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--services.workloadh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.updated--services.staffsh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--sales.saleh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--sales.sale-historyh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.system-eventsh @ 9caf500….js:2109
    9caf500….js:2109 Send Array[16]h @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 disconnected: slow trueh @ 9caf500….js:2109
    9caf500….js:2109 Status connected -> disconnectedh @ 9caf500….js:2109
    9caf500….js:2109 reconnect after 1271 millisecondsh @ 9caf500….js:2109
    9caf500….js:2109 start connectingh @ 9caf500….js:2109
    9caf500….js:2109 Status disconnected -> connectingh @ 9caf500….js:2109
    9caf500….js:2109 reset retries count to 0h @ 9caf500….js:2109
    9caf500….js:2109 Send Array[1]h @ 9caf500….js:2109
    9caf500….js:2109 Received Array[1]h @ 9caf500….js:2109
    9caf500….js:2109 Status connecting -> connectedh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.mango-api-notification_13h @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.mango-api-notification_23h @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.multiple-user-mode--clientsh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.multiple-user-mode--servicesh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--clients.clientsh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--clients.tasksh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.sync--services.clientsh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.sync--services.visitsh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--services.tasksh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--services.occupancyh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.sync--services.occupancy-per-weekh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--services.workloadh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.updated--services.staffsh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--sales.saleh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--sales.sale-historyh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.system-eventsh @ 9caf500….js:2109
    9caf500….js:2109 Send Array[16]h @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 disconnected: slow trueh @ 9caf500….js:2109
    9caf500….js:2109 Status connected -> disconnectedh @ 9caf500….js:2109
    9caf500….js:2109 reconnect after 1789 millisecondsh @ 9caf500….js:2109
    9caf500….js:2109 start connectingh @ 9caf500….js:2109
    9caf500….js:2109 Status disconnected -> connectingh @ 9caf500….js:2109
    9caf500….js:2109 reset retries count to 0h @ 9caf500….js:2109
    9caf500….js:2109 Send Array[1]h @ 9caf500….js:2109
    9caf500….js:2109 Received Array[1]h @ 9caf500….js:2109
    9caf500….js:2109 Status connecting -> connectedh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.mango-api-notification_13h @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.mango-api-notification_23h @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.multiple-user-mode--clientsh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.multiple-user-mode--servicesh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--clients.clientsh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--clients.tasksh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.sync--services.clientsh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.sync--services.visitsh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--services.tasksh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--services.occupancyh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.sync--services.occupancy-per-weekh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--services.workloadh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.updated--services.staffsh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--sales.saleh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--sales.sale-historyh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.system-eventsh @ 9caf500….js:2109
    9caf500….js:2109 Send Array[16]h @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 disconnected: slow trueh @ 9caf500….js:2109
    9caf500….js:2109 Status connected -> disconnectedh @ 9caf500….js:2109
    9caf500….js:2109 reconnect after 1336 millisecondsh @ 9caf500….js:2109
    9caf500….js:2109 start connectingh @ 9caf500….js:2109
    9caf500….js:2109 Status disconnected -> connectingh @ 9caf500….js:2109
    9caf500….js:2109 reset retries count to 0h @ 9caf500….js:2109
    9caf500….js:2109 Send Array[1]h @ 9caf500….js:2109
    9caf500….js:2109 Received Array[1]h @ 9caf500….js:2109
    9caf500….js:2109 Status connecting -> connectedh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.mango-api-notification_13h @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.mango-api-notification_23h @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.multiple-user-mode--clientsh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.multiple-user-mode--servicesh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--clients.clientsh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--clients.tasksh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.sync--services.clientsh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.sync--services.visitsh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--services.tasksh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--services.occupancyh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.sync--services.occupancy-per-weekh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--services.workloadh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.updated--services.staffsh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--sales.saleh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--sales.sale-historyh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.system-eventsh @ 9caf500….js:2109
    9caf500….js:2109 Send Array[16]h @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 disconnected: slow trueh @ 9caf500….js:2109
    9caf500….js:2109 Status connected -> disconnectedh @ 9caf500….js:2109
    9caf500….js:2109 reconnect after 1115 millisecondsh @ 9caf500….js:2109
    9caf500….js:2109 start connectingh @ 9caf500….js:2109
    9caf500….js:2109 Status disconnected -> connectingh @ 9caf500….js:2109
    9caf500….js:2109 reset retries count to 0h @ 9caf500….js:2109
    9caf500….js:2109 Send Array[1]h @ 9caf500….js:2109
    9caf500….js:2109 Received Array[1]h @ 9caf500….js:2109
    9caf500….js:2109 Status connecting -> connectedh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.mango-api-notification_13h @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.mango-api-notification_23h @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.multiple-user-mode--clientsh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.multiple-user-mode--servicesh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--clients.clientsh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--clients.tasksh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.sync--services.clientsh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.sync--services.visitsh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--services.tasksh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--services.occupancyh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.sync--services.occupancy-per-weekh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--services.workloadh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.updated--services.staffsh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--sales.saleh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--sales.sale-historyh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.system-eventsh @ 9caf500….js:2109
    9caf500….js:2109 Send Array[16]h @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 disconnected: slow trueh @ 9caf500….js:2109
    9caf500….js:2109 Status connected -> disconnectedh @ 9caf500….js:2109
    9caf500….js:2109 reconnect after 1436 millisecondsh @ 9caf500….js:2109
    9caf500….js:2109 start connectingh @ 9caf500….js:2109
    9caf500….js:2109 Status disconnected -> connectingh @ 9caf500….js:2109
    9caf500….js:2109 reset retries count to 0h @ 9caf500….js:2109
    9caf500….js:2109 Send Array[1]h @ 9caf500….js:2109
    9caf500….js:2109 Received Array[1]h @ 9caf500….js:2109
    9caf500….js:2109 Status connecting -> connectedh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.mango-api-notification_13h @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.mango-api-notification_23h @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.multiple-user-mode--clientsh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.multiple-user-mode--servicesh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--clients.clientsh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--clients.tasksh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.sync--services.clientsh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.sync--services.visitsh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--services.tasksh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--services.occupancyh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.sync--services.occupancy-per-weekh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--services.workloadh @ 9caf500….js:2109
    9caf500….js:2109 last uid found and sent for channel production.updated--services.staffsh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--sales.saleh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.sync--sales.sale-historyh @ 9caf500….js:2109
    9caf500….js:2109 no last uid found for channel production.system-eventsh @ 9caf500….js:2109
    9caf500….js:2109 Send Array[16]h @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 Received Objecth @ 9caf500….js:2109
    9caf500….js:2109 disconnected: slow trueh @ 9caf500….js:2109
    9caf500….js:2109 Status connected -> disconnectedh @ 9caf500….js:2109
    9caf500….js:2109 reconnect after 1265 millisecondsh @ 9caf500….js:2109
    9caf500….js:2109 start connectingh @ 9caf500….js:2109
    9caf500….js:2109 Status disconnected -> connectingh @ 9caf500….js:2109
    9caf500….js:2109 reset retries count to 0
    
    
  • [question] Alternative engines support

    [question] Alternative engines support

    in the application.go there is a hook into the engine

    // engine to use - in memory or redis. engine Engine

    I have am using NSQ, as well as NATS. These are both 100% golang based message queues. NSQ has storage.

    https://github.com/nsqio/nsq

    https://github.com/nats-io/gnatsd

    At the moment i use NSQ for microservices and large application. You can string together micro service libraries, without having to get into the HTTP Request Response stuff, but instead just passing messages with body payloads of data between them.

    The other thing is that NATS and NSQ dont have great support for interacting with the Web client, Or mobiel client, and so Centrifo would get allot of support if it integrated with these well used MQ libds like NSQ and NATS.

    Just an idea at this stage, and i have not had a chance to look at the interface that woudl need to be supported.

    Oh and lastly, NSQ and NATS are both in the process of getting a Discovery Service integration, so that they can run on large Kubernetes clusters. Each Server, has a MQ daemon running with it. There are many lookup daemons that know all the MQ daemons, and the topics and channels they all use. So at the code level, you can ask for the topic, and publish to it, and not have to know anything about what or where that other server is.

    Basically, in summary, NSQ and NATs, will allow Centrigio to scale out on clouds much easier. I knwo Redis can also scale out on k8 (kubernettes), but its no as decoupled is my point.

  • Option to use Nats server as PUB/SUB broker

    Option to use Nats server as PUB/SUB broker

    This is a proof of concept of using Nats server instead of Redis for PUB/SUB part of Centrifugo. I am still considering is it worth adding this or not, any feedback is welcome.

  • User limit per channel - how to get the response in client side?

    User limit per channel - how to get the response in client side?

    Ask your question

    Please provide as many details as possible – you will get the answer much faster then! Using Centrifugo v2.5.1 (Go version: go1.14.3) on linux Centos 7.

    Basically we have restricted users to one connection to a specific channel using "client_user_connection_limit": 1, parameter.

    Everything works fine. We are trying to find a way to handle connection limit error on client side.

    image

    We have checked all events, all we get is disconnected event in the above sceanrio.

    Any help would be appreciated.

    "Show us an example of what you mean!"

    An example can be useful, otherwise we're left guessing!

    1. run centrifugo server with client_user_connection_limit": 1.
    2. Try to establish connection from one browser tab.
    3. Try to duplicate tab and open another session to centrifugo.
    4. Open inspect and check WS tab in inspect for websocket responses.

    How to handle that error on client side? …

  • tls: no cipher suite supported by both client and server

    tls: no cipher suite supported by both client and server

    I've got thousands or error messages in the log, like this:

    Jan 23 06:25:48 ws centrifugo[1923]: 2017/01/23 06:25:48 http: TLS handshake error from xxx.xxx.xxx.x:48794: tls: no cipher suite supported by both client and server
    

    This produces about 4GB of entries written to the log file per day..

    This comes from browsers/os like this:

    Mozilla/5.0 (X11; Linux armv7l) AppleWebKit/537.42 (KHTML, like Gecko) Chromium/25.0.1349.2 Chrome/25.0.1349.2 Safari/537.42
    ChromeChrome 25.0.1349.2, Linux X11
    
    Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36
    ChromeChrome 49.0.2623.112, Windows XP
    
    Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.78.2 (KHTML, like Gecko) Version/6.1.6 Safari/537.78.2
    SafariSafari 6.1.6, OS X 10.7.5
    

    As i see this is only happening on old browsers and os...

    Do you know if there's a solution for this? Maybe a fallback connection to http?

  • How can i configure SSL?

    How can i configure SSL?

    Hi, I don't know how to configure centrifugo to have SSL endpoint. I am running the app on port 8000 and i want to use https://xxxxx:8000 not http://xxxxx:8000

    I have this error message : was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint This request has been blocked; the content must be served over HTTPS.

    Thanks

  • Centrifugo v2

    Centrifugo v2

    Hello dear Centrifugers.

    The work on Centrifugo 2 started in the end of 2017 and it's now almost done. It will serve the same purpose as Centrifugo v1 but won't be backwards compatible – migration to it will require adapting both backend and frontend sides of your application (of course if you decide to migrate). Changes are not too difficult. I will try to write more information later. For now you can look at post describing some of v2 aspects and reasons lead to some decisions. It's not fully actual at moment but the main ideas are the same.

    Several highlights of v2:

    • Cleaner and more structured protocol defined in protobuf schema
    • binary Websocket support (Protobuf). Of course JSON still there
    • JWT for authentication instead of hand-crafted HMAC sign
    • ~~GRPC client transport (not for browser)~~ (see below)
    • Prometheus integration and automatic export of stats to Graphite
    • Refactored Javascript (ES6), Go and gomobile client libraries.
    • Simplified API auth (got rid of request body signing)
    • GRPC for server API
    • Structured logging
    • Mechanism to merge several Websocket messages into one
    • Better recovery algorithm to fix several recovered flag false positives
    • Goreleaser for automatic releases to Github (previously I have to upload everything manually)
    • Based on new library centrifuge for Go language

    Some things were removed from Centrifugo in v2 release:

    • publishing over Redis queue
    • admin websocket endpoint
    • client limited channels
    • websocket prepared message support

    Some things you can help with as it's really hard to do everything myself:

    All these tasks require you already familiar with Centrifugo or want to dive deeper as you need to understand how things work internally.

    During next days I am planning to work on docs - most of them must be written from scratch so I don't know how much time it will take. Docs prototype located here. Centrifugo v2 itself is in c2 branch.

    At moment I am looking forward for developers who are using Centrifugo and want to review Centrifugo v2 at its alpha and beta state. If you ever wanted something backwards incompatible to be added into Centrifugo core - this is the right moment to say. Please contact me here, over email or Gitter.

  • v2.2.0 websocket bug

    v2.2.0 websocket bug

    {"level":"debug","method":"POST","path":"/admin/api","addr":"43.228.36.46:35570","duration":0.49352,"time":"2019-04-15T16:51:52+08:00","message":"http request"}

  • Centrifugo setup with ISP manager (Nginx + Apache)

    Centrifugo setup with ISP manager (Nginx + Apache)

    upstream centrifugo {
        ip_hash;
        server 127.0.0.1:8000;
    }
    server {
    	server_name *******.ru www.*******.ru;
    	ssl on;
    	ssl_certificate "/var/www/httpd-cert/*******/*******.ru.crtca";
    	ssl_certificate_key "/var/www/httpd-cert/*******/*******.ru.key";
    	ssl_ciphers EECDH:+AES256:-3DES:RSA+AES:RSA+3DES:!NULL:!RC4:!RSA+3DES;
    	ssl_prefer_server_ciphers on;
    	ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    	add_header Strict-Transport-Security "max-age=31536000;";
    	ssl_dhparam /etc/ssl/certs/dhparam4096.pem;
    	charset off;
    	index index.html index.php;
    	disable_symlinks if_not_owner from=$root_path;
    	include /etc/nginx/vhosts-includes/*.conf;
    	include /etc/nginx/vhosts-resources/*******.ru/*.conf;
    	access_log /var/www/httpd-logs/*******.ru.access.log;
    	error_log /var/www/httpd-logs/*******.ru.error.log notice;
    	ssi on;
    	set $root_path /var/www/*******/data/www/*******.ru/public;
    	gzip on;
    	gzip_comp_level 5;
    	gzip_disable "msie6";
    	gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
    	location / {
    		location ~ [^/]\.ph(p\d*|tml)$ {
    			try_files /does_not_exists @fallback;
    		}
    		location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
    			expires 7d;
    			try_files $uri $uri/ @fallback;
    		}
    		location / {
    			try_files /does_not_exists @fallback;
    		}
    	}
    	location @fallback {
    		proxy_pass http://127.0.0.1:8080;
    		proxy_redirect http://127.0.0.1:8080 /;
    		proxy_set_header Host $host;
    		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    		proxy_set_header X-Forwarded-Proto $scheme;
    		proxy_set_header X-Forwarded-Port $server_port;
    		access_log off;
    	}
            location /centrifugo/ {
                    proxy_pass http://centrifugo;
                    proxy_set_header Host $host;
                    proxy_http_version 1.1;
            }
    	root $root_path;
    	listen 185.87.49.66:443;
    	listen [2a02:f680:1:1100::3985]:443;
    }
    

    config.json

    {
      "secret": "*****",
      "ssl": true,
      "ssl_key": "/var/www/httpd-cert/*****/*****.ru.key",
      "ssl_cert": "/var/www/httpd-cert/*****/*****.ru.crt",
      "web": "true",
      "admin": "true",
      "admin_password": "*****",
      "admin_secret": "*****",
      "log_level": "info",
      "publish": true,
      "watch": true,
      "presence": true,
      "join_leave": true,
      "recover": false,
      "http_prefix": "/centrifugo"
    }
    
    2017/10/02 22:53:32 [error] 7483#7483: *1 upstream sent no valid HTTP/1.0 header while reading response header from upstream, client: 91.246.98.164, server: hardcsgo.ru, request: "GET /centrifugo/ HTTP/1.1", upstream: "http://127.0.0.1:8000/centrifugo/", host: "****.ru"
    2017/10/02 22:53:32 [error] 7483#7483: *1 readv() failed (104: Connection reset by peer) while reading upstream, client: 91.246.98.164, server: hardcsgo.ru, request: "GET /centrifugo/ HTTP/1.1", upstream: "http://127.0.0.1:8000/centrifugo/", host: "*****.ru"
    

    При попытке соединения http://SSMaker.ru/00af39aa/

  • Centrifugo v3: the work has been started

    Centrifugo v3: the work has been started

    Hello! After a 2.5 years of Centrifugo v2 life cycle looks like we approach a time for Centrifugo v3 🎉

    There are several cool ideas in my head – some are definitely useful, some still need to be evaluated more. I'll try to share soon - here or in our community channels.

    The work has already been started and the current release target is end of summer.

    Centrifugo v3 should be client protocol compatible (mostly)

    Some deprecated things will be removed (seq/gen fields for example) and maybe minor cosmetic JSON changes - the important thing is to keep mobile applications working due to long and painful update cycle. I believe that the current client protocol is good enough to keep for v3.

    I am planning to change the default behaviour of history call - it won't receive all publications by default, but going to provide an option to turn on old behaviour until clients migrate to new API.

    Centrifugo v3 should be feature compatible

    Existing features should stay and it should be possible to migrate any existing application that works with Centrifugo v2 to v3. There will be some configuration option changes on backend, some craft will be removed.

    Centrifugo v3 can have different license and PRO version

    Since project is big enough and requires more and more time to maintain I am trying to evaluate a way to make Centrifugo development sustainable. This means that I can proceed with an idea of having Centrifugo Pro version with additional features on top of base version. The alternative way over Opencollective organization did not work well (I believe mostly because I have to put more effort into this initiative but don't really have enough time and energy for it). So going to try another direction.

    Also, I am considering moving from MIT to AGPL v3 license for Centrifugo v3, please contact me directly over email if you have concerns about this. This is not a final decision yet but I don't see real downsides for a project in making this move at the moment.

    Do you have any proposals for v3?

    If you have any ideas - please share here (or feel free to do it over mail, community rooms), this is the right time – even if the idea won't be implemented it can point Centrifugo to some direction I never thought about myself, or I'll be able to foresee the design for extending Centrifugo in the future.

    Appreciate any feedback. Thanks, guys.

  • Centrifugo v5 roadmap

    Centrifugo v5 roadmap

    Centrifugo v4 release was quite huge. It contained several big changes, some of them were backwards incompatible. Most probably Centrifugo v5 won't contain such a huge number of changes, but we need to release v5 to drop support for client protocol v1 and do some other breaking changes (see details below).

    Dropping Client protocol v1

    To remind you about client protocol v1 vs v2 migration in Centrifugo v4 take a look at v3 to v4 migration guide. Centrifugo v4 uses client protocol v2 by default, all our recent SDKs only support client protocol v2. So removing support for v1 which adds craft to the code base, confusion to users is a necessary step. Looks like it should be part of v5.

    For those using modern Centrifugo stack - v4 and most recent SDK versions – this won't introduce any notable compatibility issues.

    history_meta_ttl refactoring

    I'd like to refactor history_meta_ttl option, as it's pretty awkward at the moment and does not allow implementing patterns like https://github.com/centrifugal/examples/tree/master/v4/go_async_processing flexibly. See https://github.com/centrifugal/centrifuge/pull/264 which contains initial prototyping of the idea to move history_meta_ttl from global to a channel level.

    I'll try to find a way to avoid breaking changes in the configuration, providing global history_meta_ttl option value. It seems possible.

    Update Centrifugo node communication protocol

    One shot encode/decode for control proto, to make node communication protocol a bit faster and similar to our client protocol. This will lead to the fact that Centrifugo nodes of different versions will speak different not compatible protocols, thus this should be part of v5. See https://github.com/centrifugal/centrifuge/pull/263 for implementation.

    Since this is an internal thing – users won't need to do anything specific upon upgrading Centrifugo from v4 to v5, just make sure Centrifugo cluster does not have both v4 and v5 nodes at the same moment.

    Will deprecated SockJS be removed?

    My thinking is that not in v5. It does not introduce much of complexity for us, so let's wait a bit more. Would be awesome to listen to stories where SockJS still makes sense. I suppose Centrifugo own emulation layer should replace it perfectly in most cases.

    When?

    The plan is to prepare Centrifugo v5 till March 2023. Though it may come a bit later. Probably this roadmap will be updated in some way, please consider it as a draft for now.

  • Bump goreleaser/goreleaser-action from 3 to 4

    Bump goreleaser/goreleaser-action from 3 to 4

    Bumps goreleaser/goreleaser-action from 3 to 4.

    Release notes

    Sourced from goreleaser/goreleaser-action's releases.

    v4.0.0

    What's Changed

    Full Changelog: https://github.com/goreleaser/goreleaser-action/compare/v3...v4.0.0

    v3.2.0

    What's Changed

    • chore: remove workaround for setOutput by @​crazy-max (#374)
    • chore(deps): bump @​actions/core from 1.9.1 to 1.10.0 (#372)
    • chore(deps): bump yargs from 17.5.1 to 17.6.0 (#373)

    Full Changelog: https://github.com/goreleaser/goreleaser-action/compare/v3.1.0...v3.2.0

    v3.1.0

    What's Changed

    • fix: dist resolution from config file by @​crazy-max (#369)
    • ci: fix workflow by @​crazy-max (#357)
    • docs: bump actions to latest major by @​crazy-max (#356)
    • chore(deps): bump crazy-max/ghaction-import-gpg from 4 to 5 (#360)
    • chore(deps): bump ghaction-import-gpg to v5 (#359)
    • chore(deps): bump @​actions/core from 1.6.0 to 1.8.2 (#358)
    • chore(deps): bump @​actions/core from 1.8.2 to 1.9.1 (#367)

    Full Changelog: https://github.com/goreleaser/goreleaser-action/compare/v3.0.0...v3.1.0

    Commits
    • 8f67e59 chore: regenerate
    • 78df308 chore(deps): bump minimatch from 3.0.4 to 3.1.2 (#383)
    • 66134d9 Merge remote-tracking branch 'origin/master' into flarco/master
    • 3c08cfd chore(deps): bump yargs from 17.6.0 to 17.6.2
    • 5dc579b docs: add example when using workdir along with upload-artifact (#366)
    • 3b7d1ba feat!: remove auto-snapshot on dirty tag (#382)
    • 23e0ed5 fix: do not override GORELEASER_CURRENT_TAG (#370)
    • 1315dab update build
    • b60ea88 improve install
    • 4d25ab4 Update goreleaser.ts
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Bump github.com/centrifugal/protocol from 0.8.11 to 0.9.0

    Bump github.com/centrifugal/protocol from 0.8.11 to 0.9.0

    Bumps github.com/centrifugal/protocol from 0.8.11 to 0.9.0.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • [feature] Implement subscription refresh proxy

    [feature] Implement subscription refresh proxy

    Is your feature request related to a problem? Please describe.

    We now have Refresh proxy, which allows to notify backend periodically while connection is alive. For completeness and for possibility to implement some interesting features (like subscribing and consuming external streams, where application need to be sure subscription still occupied) would be awesome to have subscription refresh proxy also.

    Describe the solution you'd like.

    Actually, Centrifuge library already has OnSubRefresh handler – so this feature is mostly similar to our refresh proxy in implementation.

  • [question] Anonymous Access

    [question] Anonymous Access

    Ask your question. Please provide as many details as possible – you will get the answer much faster then!

    Is there a way to disable Anonymous Access when authenticating to websocket?

    "Show us an example of what you mean!". An example can be useful, otherwise we're left guessing!

    1. Guest on website
    2. Frontend sends api request to backend to refresh token
    3. Backend generates a jwt token with empty sub and returns it to Frontend
    4. Centrifuge SDK loads the token and tries to connect to the Websocket Server with the provided jwt token from the backend
    5. Centrifuge server denies the connection because the sub claim is empty, not allowed

    I'd like a way to configure centrifuge to check this instead of doing it by myself with my backend, like

    {
      "anonymous_access": false,
      "namespaces": [...]
    }
    
A simple server for sending and receiving messages in real-time per WebSocket. (Includes a sleek web-ui)
A simple server for sending and receiving messages in real-time per WebSocket. (Includes a sleek web-ui)

A simple server for sending and receiving messages in real-time per WebSocket. (Includes a sleek web-ui)

Jan 9, 2023
Open-IM-Server is open source instant messaging Server.Backend in Go.
Open-IM-Server is open source instant messaging Server.Backend in Go.

Open-IM-Server is open source instant messaging Server.Backend in Go.

Dec 31, 2022
Instant messaging platform. Backend in Go. Clients: Swift iOS, Java Android, JS webapp, scriptable command line; chatbots
Instant messaging platform. Backend in Go. Clients: Swift iOS, Java Android, JS webapp, scriptable command line; chatbots

Tinode Instant Messaging Server Instant messaging server. Backend in pure Go (license GPL 3.0), client-side binding in Java, Javascript, and Swift, as

Jan 6, 2023
Berty is a secure peer-to-peer messaging app that works with or without internet access, cellular data or trust in the network
Berty is a secure peer-to-peer messaging app that works with or without internet access, cellular data or trust in the network

?? Berty is a secure peer-to-peer messaging app that works with or without internet access, cellular data or trust in the network Introduction Berty i

Dec 29, 2022
Self hosted live chat server written in Go

goch is a self-hosted live-chat server written in Go. It allows you to run a live-chat software on your own infrastructure. You can create multip

Dec 11, 2022
Simple TCP-based chat server

hub-server Simple TCP-based chat server. Client can be found: https://github.com/alankritjoshi/hub-client Setup go run server.go 1234 How it works Use

Oct 25, 2021
Scalable real-time messaging server in language-agnostic way
Scalable real-time messaging server in language-agnostic way

Centrifugo is a scalable real-time messaging server in language-agnostic way. Centrifugo works in conjunction with application backend written in any

Jan 1, 2023
💨 A real time messaging system to build a scalable in-app notifications, multiplayer games, chat apps in web and mobile apps.
💨 A real time messaging system to build a scalable in-app notifications, multiplayer games, chat apps in web and mobile apps.

Beaver A Real Time Messaging Server. Beaver is a real-time messaging server. With beaver you can easily build scalable in-app notifications, realtime

Jan 1, 2023
Real-time Map displays real-time positions of public transport vehicles in Helsinki
Real-time Map displays real-time positions of public transport vehicles in Helsinki

Real-time Map Real-time Map displays real-time positions of public transport vehicles in Helsinki. It's a showcase for Proto.Actor - an ultra-fast dis

Nov 30, 2022
Cadence is a distributed, scalable, durable, and highly available orchestration engine to execute asynchronous long-running business logic in a scalable and resilient way.

Cadence Visit cadenceworkflow.io to learn about Cadence. This repo contains the source code of the Cadence server. To implement workflows, activities

Jan 9, 2023
Real-time messaging library for Go with scalability in mind.

This library has no v1 release, API still evolves. Use with strict versioning. Before v1 release patch version updates only have backwards compatible

Dec 31, 2022
Instant messaging server for the Extensible Messaging and Presence Protocol (XMPP).
Instant messaging server for the Extensible Messaging and Presence Protocol (XMPP).

Instant messaging server for the Extensible Messaging and Presence Protocol (XMPP).

Dec 31, 2022
Scalable datastore for metrics, events, and real-time analytics

InfluxDB InfluxDB is an open source time series platform. This includes APIs for storing and querying data, processing it in the background for ETL or

Jan 5, 2023
Scalable datastore for metrics, events, and real-time analytics

InfluxDB InfluxDB is an open source time series platform. This includes APIs for storing and querying data, processing it in the background for ETL or

Jan 4, 2023
Go-random-chat - Fast and scalable real-time random chat written in go
Go-random-chat - Fast and scalable real-time random chat written in go

Go Random Chat Fast and scalable real-time random chat written in go. Features:

Dec 21, 2022
Tigris is a modern, scalable backend for building real-time websites and apps.

Tigris Data Getting started These instructions will get you through setting up Tigris Data locally as Docker containers. Prerequisites Make sure that

Dec 27, 2022
A LoRaWAN nodes' and network simulator that works with a real LoRaWAN environment (such as Chirpstack) and equipped with a web interface for real-time interaction.
A LoRaWAN nodes' and network simulator that works with a real LoRaWAN environment (such as Chirpstack) and equipped with a web interface for real-time interaction.

LWN Simulator A LoRaWAN nodes' simulator to simulate a LoRaWAN Network. Table of Contents General Info Requirements Installation General Info LWN Simu

Nov 20, 2022
Simple-messaging - Brokerless messaging. Pub/Sub. Producer/Consumer. Pure Go. No C.

Simple Messaging Simple messaging for pub/sub and producer/consumer. Pure Go! Usage Request-Response Producer: consumerAddr, err := net.ResolveTCPAddr

Jan 20, 2022
Fast specialized time-series database for IoT, real-time internet connected devices and AI analytics.
Fast specialized time-series database for IoT, real-time internet connected devices and AI analytics.

unitdb Unitdb is blazing fast specialized time-series database for microservices, IoT, and realtime internet connected devices. As Unitdb satisfy the

Jan 1, 2023