Repository navigation
Releases
v6.10.4
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, Rust, 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
Improvements
- Detection of Redis lost writes. Redis replication and persistence are asynchronous: after a failover to a replica which missed the latest writes, or a restart from an older RDB or AOF file, a channel's history could lose its latest publications while keeping its epoch. New publications then reused offsets clients had already seen, and clients skipped them as duplicates. Maps had the same problem with their change streams. With the new
engine.redis.detect_lost_writesoption, Centrifugo detects that a Redis server may have lost writes, and channels and maps stored on that server start a new epoch, so subscribers resync from the current state instead of silently missing publications. On Redis 7+ and Valkey it detects every restart and failover and needs no extra permissions. On Redis 6, DragonflyDB and AWS ElastiCache Serverless it detects lost writes in channels with subscribers. Off by default. Enable it on every Centrifugo node, and expect one resync of subscribers after every failover or restart of a Redis server, also one which lost nothing. Reported by @mattjcowan (#1319, #1332, centrifugal/centrifuge#686, centrifugal/centrifuge#693).engine.redis.detect_lost_writes_with_infodetects with the RedisINFOcommand instead: also on Redis 6 and DragonflyDB in all channels, and also a quick failback to the old primary. It needs the@dangerousACL category and gives more resyncs without any loss â see the docs before enabling it.- Both options are also available for a separate Redis broker (
broker.redis.*) and the Redis map broker (map_broker.redis.*). - At start, Centrifugo logs a
redis potential lost writes detectionline for every Redis shard, also with the options off: which detection is in use and what the server supports. Check it before enabling the options. - New metrics
centrifugo_broker_redis_potential_lost_writes_detectionsandcentrifugo_broker_redis_potential_lost_writes_epoch_resets. - Along with this work, Valkey, AWS ElastiCache (node-based clusters and Serverless) and Google Memorystore (for Redis, for Redis Cluster, for Valkey) were tested with history, maps, PUB/SUB delivery, failovers, maintenance events and resharding. See Redis compatible storages for the results and connection notes. KeyDB has not been updated for a long time, so we do not recommend it anymore.
- New
channel.history_meta_ttl_initialoption: a shorter TTL for the stream and map meta of channels nobody published to yet. Subscribing to a channel with positioning or recovery, or requesting its history, creates its meta even without publications, and it was kept forhistory_meta_ttl(30 days by default). Where clients can choose channel names, subscriptions and history requests to many channels nobody publishes to left that many long-lived keys in Redis or rows in PostgreSQL; with the option (for example5m) they don't. Live subscribers keep the meta while they stay subscribed, and the first publication switches it to the usual TTL. The cost: a client away longer than the option from a channel nobody published to can't recover what was published meanwhile, and is told to resync. It can be set per namespace (history_meta_ttl_initial) and per map (map.meta_ttl_initial), where-1disables it for the namespace's channels. The value must be at least 3 Ãclient.channel_position_check_delay: a shorter one is raised to it, with a warning on start. Off by default (#1332, #1335, centrifugal/centrifuge#687, centrifugal/centrifuge#702). - Kafka consumer: new
start_offsetoption,earliest(default, as before) orlatest. It applies to partitions without a committed offset in the consumer group â a new group, or a topic added to an existing one. Withlatesta new group starts from new records only, instead of sending everything still in retention to online clients in publication data mode. Thanks @thuy-le-kafi (#1321). - New
startup_wait_timeoutoption of Redis configurations (engine, broker, presence manager, map broker, Redis Stream consumer): how long Centrifugo waits on start for Redis which is not reachable yet or is still loading its dataset, instead of exiting at the first failed attempt to connect. Not set by default. Centrifugo does not listen while it waits, so in Kubernetes a long timeout needs astartupProbe. Thanks @BeyondEvil (#1327, #1330, centrifugal/centrifuge#690). - Redis PUB/SUB: messages waiting to be processed on a node are now bounded by their size, not by count, and take memory only while they wait. Before, every PUB/SUB processor allocated a buffer of 4096 messages on start, which took memory even while idle, and held up to 4096 messages of any size. The new
pub_sub_queue_max_sizeoption (default 64 MB, for all PUB/SUB connections of a broker together) sets the limit forengine.redis,broker.redisandmap_broker.redis. Bursts of small messages get more room than before; of large messages, fewer wait. Over the limit messages are dropped, as before when the buffer was full (#1338, centrifugal/centrifuge#699). - Server HTTP API: request bodies are limited by the new
http_api.max_request_body_sizeoption, 32 MB by default. A larger request gets HTTP 413. Before, a body of any size was read into memory. The admin web UI API uses the same default limit. Thanks @aloneangel45, reported by @GG-Feng (#1328, #1340). - JWKS: a response of the JWKS endpoint larger than 1 MB now fails the key fetch instead of being read into memory in full. Thanks @draarivpatel-ui, reported by @GG-Feng (#1329, #1339).
- Bad requests are logged at warn level, not error: server API requests which fail validation or can't be decoded, and server API errors caused by the request (bad request, unknown channel, not found, unrecoverable position, conflict), as well as malformed requests to unidirectional transports and WebTransport. Internal errors stay at error level. Alerts which match these messages at error level no longer fire (#1334).
- WebSocket: pings from a client are now limited to a burst of 10 and 1 per second after it, far above what keepalive needs. A client pinging faster is disconnected with close code 1008 (
too many pings). Before, nothing bounded them, and each ping cost the server a write (centrifugal/centrifuge#684). - WebSocket: after a disconnect or a refused connect, Centrifugo reads at most 32 messages from the client while waiting for its close frame. A closing client still completes the closing handshake and sees the close code, but a client which keeps sending is closed at once instead of being read for up to 5 seconds. In a test with clients flooding commands and getting disconnected, server CPU dropped about a hundred times (centrifugal/centrifuge#683).
- Unidirectional WebSocket: after connect, only replies to pings are accepted from the client, one per pin...
v6.10.3
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, Rust, 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
Improvements
- New
--watch-config-fileflag restarts Centrifugo when the configuration in its config file changes â for development. All options apply, unlike with SIGHUP reload. A change which fails validation is logged and ignored, and Centrifugo keeps running. The restart happens in the same process, which keeps its PID. See restart on config file change (#502, #1302). - Graceful shutdown now covers everything Centrifugo runs (#1302). See signal handling:
- async consumers â Kafka, Redis Streams, NATS JetStream, PostgreSQL outbox, AWS SQS, Google Cloud PUB/SUB and Azure Service Bus â stop taking new messages, then finish and acknowledge the messages they already took. A message processed right before a stop is no longer delivered again after the restart;
- connections to Redis, PostgreSQL, NATS, proxy endpoints and JWKS endpoints are closed, and buffered OpenTelemetry spans are exported;
- the whole shutdown finishes within
shutdown.timeout. If it doesn't, Centrifugo logsshutdown timeout reachedand exits with code 1, as before; - when a server, an async consumer or another component fails after start, Centrifugo shuts down gracefully before exiting with code 1, instead of exiting at once;
- startup errors such as a port in use or a bad TLS configuration are reported before Centrifugo starts processing messages from async consumers.
- New channel options
recovery_max_publication_limitandhistory_max_publication_limitset the maximum number of publications returned in one recovery and in one history request for a namespace. Before, onlyclient.recovery_max_publication_limitandclient.history_max_publication_limitexisted, applying to all channels. A namespace whose history holds many small publications â for example, AI responses streamed in chunks â can now have a higher limit than the rest. Zero, the default, keeps using theclient.*options. See channel options and Centrifugo for AI apps (#1294, centrifugal/centrifuge#674). - Better comments in Protobuf definitions for server API and Proxy.
Fixes
- SIGHUP reload pointing channel or RPC options to a proxy which was not created on start was reported as successful, and the next operation using that proxy panicked. Such a reload is now rejected with an error, and the previous configuration stays active â a restart is required to start using a new proxy. Note: enabling a proxy kind for which no proxy was created on start used to reload successfully and then return
108 not availableto clients, and is now rejected too. See signal handling (#1300). - Redis Streams consumer: messages read from Redis right before shutdown could be left unprocessed, and processed only once
visibility_timeoutpassed (30 seconds by default) (#1307). - A server-side subscribe, refresh or message sent with the server API to a client which was still connecting could reach the client before its connect reply. They now come after it (centrifugal/centrifuge#676).
- Other subscribers of a channel could get a leave event without a join event for a client whose server-side subscribe happened while its message queue was full (centrifugal/centrifuge#673).
Miscellaneous
- New Server SDKs page in the docs lists the official server SDKs â
gocent,pycent,jscent,phpcent,rubycent,rustcentandcsharpcentâ with install lines, a first publication in each language, notes for AI coding agents, and when to use GRPC instead of the HTTP API. All server SDKs follow a common SDK spec and include not only Centrifugo HTTP API client, but also helper methods for connection/subscription token generation, shared poll signatures, helpers functions to implement proxy handlers. - Introducing centrifuge-rust â a new official client SDK, with Tauri and WASM support out of the box.
- Centrifugo for AI apps now covers checkpoints for long responses, loading a conversation with
getState, and stopping generation from every device. See the new Vercel AI SDK chat example. - Web UI is updated to the latest dependencies (#1305).
- This release is built with Go 1.27.3.
- Dependency updates.
- See also the corresponding Centrifugo PRO release.
v6.10.2
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
Improvements
- Ed25519 public key for EdDSA tokens. New option
client.token.ed25519_public_key(and the same option inclient.subscription_token) takes a PEM encoded Ed25519 public key to verify EdDSA signed connection and subscription tokens. Before, EdDSA tokens could be verified only with keys from a JWKS endpoint, while RSA and ECDSA keys could already be set directly. See JWT authentication (#1288). - JWKS key rotation and outages no longer disconnect clients for good (#1289). See JSON Web Key support:
- a token whose key is not returned by the JWKS endpoint (for example, during a key rollout, or a token signed with a retired key) is now treated as an expired token (
109, or3005on unidirectional transports), so the client gets a new token and reconnects. Before, it was an invalid token (3500), and client SDKs stopped reconnecting; - if the JWKS endpoint can't be reached, the client gets a temporary error and retries, instead of an invalid token;
- keys loaded from the JWKS endpoint are now kept for 5 minutes instead of one hour, so a key removed from the endpoint (for example, after a leak) stops working within 5 minutes. Keys already loaded are still used while the endpoint can't be reached;
- the same applies to subscription tokens. Tokens with a bad signature or malformed tokens are still invalid.
- a token whose key is not returned by the JWKS endpoint (for example, during a key rollout, or a token signed with a retired key) is now treated as an expired token (
proxy.protonow documents every message and field: what each request field carries, what each result field changes, and which responses honourerroranddisconnect. See also proxy docs (#1287).
Fixes
- Node metrics interval in the
infoserver API is the configured interval again (e.g.60), not a slightly different measured value like59.999856375(centrifugal/centrifuge#671).
Miscellaneous
- Docker image is rebuilt with the latest Alpine
ca-certificates-bundle, which removes trust in the compromised eMudhra intermediate CA certificates. Centrifugo itself already rejected these certificates since v6.10.1 (Go 1.27.3), but other tools in the image which use the system trust store did not, and container scanners reported the image as vulnerable (#1290). - This release is built with Go 1.27.3.
- Dependency updates.
- See also the corresponding Centrifugo PRO release.
v6.10.1
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
This release was created to upgrade to Go 1.27.3 which addresses golang/go#82345
Miscellaneous
- This release is built with Go 1.27.3.
- Dependency updates.
- See also the corresponding Centrifugo PRO release.
v6.10.0
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
Improvements
- Stricter JSON parsing in the client protocol. Centrifugo now follows RFC 8259 exactly. It rejects invalid UTF-8, repeated keys, extra data after a message, keys with different letter case and too large integers. Before, such messages were partly accepted. Now Centrifugo and your backend always read a message the same way, and invalid UTF-8 can't reach browsers (a browser closes the WebSocket when it gets invalid UTF-8). Official SDKs are not affected. See two edge cases in the behaviour changes below (centrifugal/protocol#56, centrifugal/centrifuge#652, #1259).
- Centrifugo now uses its own JSON code generator,
cfjson, instead ofeasyjson(andsegmentio/encodingfor decoding), and its own Protobuf generator,cfprotobuf, instead ofvtprotobuf. JSON output is the same byte for byte. In protocol benchmarks on Linux amd64, JSON encoding takes 46% less time and JSON decoding 25% less time (centrifugal/protocol#56). - Server API errors show if a retry makes sense. Errors have a new
temporaryfield (similar to the client protocol Error field): it istruewhen the same request may succeed later. There is a new error111 too many requests(HTTP 429, gRPCResourceExhausted). Requests which can never succeed now return 107 (bad request), 102 (unknown channel) or 108 (not available) instead of100 internal, so clients don't retry them (#1247). - Faster memory broker history. History is split into 64 parts by channel, each with its own lock. Before, all channels used one lock. Publishing with history into 10000 channels from all CPUs now takes 1.61Âĩs per publication instead of 2.90Âĩs (â44%) (centrifugal/centrifuge#666).
- Faster broadcast to subscriptions with positioning: Centrifugo reads the current time once per broadcast, not once per subscriber. 10â15% faster for 100 and 1000 subscribers (centrifugal/centrifuge#665).
- Unidirectional SSE no longer copies every message when writing it to a connection. With a 1 KB payload, memory allocated per delivered message dropped from about 1,220 bytes to 58 bytes, and with a 10 KB payload from about 10,650 bytes to 330 bytes. Garbage collection almost stops in these tests, and CPU usage is a few percent lower. Unidirectional HTTP streaming also allocates a bit less per message. Thanks @darakanoit (#1251).
- Broadcast with
publication_data_formatjsonorjson_objectchecks the data once per broadcast, not once per channel. A broadcast into 1000 channels with a 10 KB payload uses 60% less CPU (7.35 ms â 2.94 ms) and is 33% faster; with a 1 KB payload it uses 17% less CPU. Thanks @darakanoit (#1252). - Faster JWKS token verification under load. A JWKS cache hit no longer takes a lock or allocates memory. Parallel connect token verification is 34% faster with RSA-2048 keys (4.76 Âĩs â 3.13 Âĩs) and 15% faster with ES256 keys. Thanks @darakanoit (#1253).
- PostgreSQL stream and map brokers no longer allocate memory on an empty outbox poll. On an idle server, the stream broker allocated 25.8 MiB per second and the map broker 11.6 MiB per second; now both allocate about 130 KiB per second, with no garbage collection cycles. Thanks @darakanoit (#1250).
- Config reload on SIGHUP improvements. Before, if a subscription token setting failed to apply, the connection token settings were already changed, and Centrifugo worked with a mix of old and new settings (#1267).
- Redis IAM authentication (experimental). Centrifugo can connect to managed Redis/Valkey with short-lived cloud tokens instead of a static password:
aws_iam_authfor Amazon ElastiCache (node-based and Serverless),gcp_iam_authfor Google Cloud Memorystore andazure_entra_authfor Azure Managed Redis and Azure Cache for Redis. Credentials come from the cloud default chain (AWS SDK credentials, Google Application Default Credentials,DefaultAzureCredential), tokens are refreshed automatically. The options work everywhere Redis is configured: engine, broker, presence manager, map broker, Redis stream consumer. See Redis IAM authentication (#1118, #1283, centrifugal/centrifuge#670). - JWKS keys are updated after key rotation. Centrifugo loads keys from the JWKS endpoint again one hour after the last load. A key removed from the endpoint stops working within one hour. Before, a key which was used all the time was never loaded again. Also, tokens with unknown
kidvalues now share one request to the JWKS endpoint, so fake tokens can't overload it (#1255, #1264).
Behaviour changes
Most setups need no changes. Please check this list before upgrading:
- Publication data for JSON subscribers must be valid UTF-8 JSON. If you publish invalid UTF-8, or binary data (gRPC
dataor HTTPb64data) into a channel with JSON subscribers, they are disconnected with code3506(centrifugal/centrifuge#652). - Async consumers retry only temporary errors (100 and 111). For other errors, Centrifugo logs the error and marks the message as processed (#1247).
- Client publish into a namespace with a non-stream subscription type (
map,map_clients,map_users,shared_poll) is now refused with103 permission denied(#1280). - Join/leave override in a subscription token now works. If the token sets
join_leave: trueand the namespace hasjoin_leaveoff, the client gets join/leave messages when it asks for them and has presence permission. Before, Centrifugo checked only the namespace option (#1277). - Nats raw mode: if a channel has
publication_data_formatset tojsonorjson_object, messages which don't match it are not delivered (#1258). - A connection token with invalid
b64infois now an invalid token. The client is disconnected. Before, it reconnected again and again with the same token. An invalidpatternin thechannelsserver API call now returns 107 (bad request) instead of 100 (internal error) (#1267).
Fixes
- Join/leave, positioning and recovery requested by a client now work for subscriptions allowed by the subscribe proxy. Join/leave also works for subscribe stream proxy subscriptions. Permission checks are the same as for other subscriptions. Thanks @AdzerKI (#1270, #1277).
- A connection without user ID could subscribe to a user-limited channel with an empty user in it, such as
user#oruser#42,. Now it can't. Channels requested on connect are no longer subscribed in a namespace with subscribe stream proxy or with a non-stream subscription type (#1279, #1280). - Subscribe stream proxy fixes (#1262, #1272):
- closing the stream of an old subscription no longer unsubscribes a new one;
- a refused stream subscription no longer keeps a goroutine until disconnect;
- a first message which comes at the same moment as the timeout no longer leaves the subscription on a closed stream.
- With
client.concurrency, disconnect no longer waits for a timeout if the client goes away while its subscribe waits in the queue (#1268). - A
nullitem in a shared poll refresh proxy response, ornullchannel options in connect proxysubs, no longer crash Centrifugo (#1265, [centrifugal/centrifuge#647](https://github...
v6.9.7
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
Improvements
- Publications into a channel are no longer delayed by clients subscribing to it with recovery or positioning (see also the fix below). In a benchmark which publishes into a channel with 100 subscribers while other clients connect with it and a second channel whose history read takes 1ms, publish latency dropped from 249Âĩs to 28Âĩs on average and from 1240Âĩs to 46Âĩs at p99. Broadcasting to a client which is not subscribing to anything now costs an atomic load instead of a mutex and a map lookup (a broadcast to 100 subscribers went from 27.4Âĩs to 23.9Âĩs).
- Faster fossil delta encoding â Centrifugo now uses centrifugal/fdelta package instead of
shadowspore/fossil-delta. Creating a delta is 3.5-4.2x faster on JSON payloads and allocates once instead of five times (128 B/op at 16 KiB against 19 KB). centrifugal/centrifuge#638. - Less memory per connection. Client command handlers copied the whole configuration (about 10 KB) onto the stack of the connection's goroutine, so the stack grew on the first commands. They now read it by reference. With 20k connections which connect and subscribe, stack memory is 35% lower and process RSS about 20% lower â about 10 KB less per connection (#1244).
- Faster channel options lookup. Options are now resolved for every namespace once â on start and on every config reload â so a lookup is a map read without allocation. Before, Centrifugo cached the options of 1024 channels, and with more channels in use (a broadcast into thousands of channels, many personal channels) lookups kept missing the cache and allocated a copy of the options each time. A broadcast into 1000 channels is 27% faster and allocates about half the memory (#1245).
- Less work per broadcast when delta compression is used by JSON clients. A JSON client receives a delta as a JSON string, so a delta may only be built when the previous payload is valid UTF-8. Now a payload is scanned at most once per broadcast, and not at all when no JSON client takes deltas. It only matters for payloads carrying non-ASCII text (
utf8.Validhas an ASCII fast path) â on such payloads the broadcast is 12-21% faster depending on the number of encoding combinations in the channel (centrifugal/centrifuge#637).
Fixes
- Fix a possible node deadlock when a client subscribes to a channel with recovery or positioning enabled. Such a subscription kept its recovery buffer locked until the subscribe result was written, while a publication into the channel waited for that buffer holding the hub shard lock â so publications, subscribes, unsubscribes, disconnects and graceful shutdown for all channels of that shard could block. Publications no longer wait for a subscribing client (centrifugal/centrifuge#640). Reported in GHSA-xcch-wm46-g65g by @EJ-Research
- Delta compression and publication tags filters are documented as mutually exclusive, but Centrifugo still negotiated delta for a subscription with a tags filter. To keep the chain of deltas intact, publications filtered out for such a subscriber were sent to it anyway â so the filter was not applied at all. Delta is no longer negotiated for subscriptions with a tags filter (centrifugal/centrifuge#634).
- Map channels: when a channel's stream expired while its top offset and epoch survived, a read since an older offset returned an empty result with no error â recovery reported
recovered: truewhile silently skipping the lost publications. Such a read now results in an unrecoverable position error, so clients resync from the full state (centrifugal/centrifuge#636). - Publications buffered while a client subscribes with recovery or positioning are now limited by
client.queue_max_sizeper connection. Before, each subscription got the whole limit for itself, so a client subscribing to many channels at once â for example with server-side subscriptions on connect â could hold many times that limit in memory (centrifugal/centrifuge#641). - Redis Cluster: a channel whose name starts with
}made the keys of that channel land in different slots, which could crash the node â for example when a client subscribed to such a channel with recovery. Such channels are now refused with a bad request error (centrifugal/centrifuge#645). - The
unsubscribeserver API method now returns a bad request error whenchannelis empty, as documented. Before, it unsubscribed nothing but still sent the targeted connections an unsubscribe push for an empty channel (#1238).
Miscellaneous
- This release is built with Go 1.26.8.
- Dependency updates.
- See also the corresponding Centrifugo PRO release.
v6.9.6
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
- A client-side subscription refresh with an already expired subscription token was accepted. The subscription's expiration time was then cleared, so the subscription never expired. Now Centrifugo closes the connection with the
3006(subscription expired) disconnect code. The client reconnects, gets a token expired error on resubscribe and requests a new token â all official SDKs already handle this (centrifugal/centrifuge#627). - Fossil delta compression with recovery: when a subscribe with recovery found no missed publications, the next publication was still sent as a delta. The client had no base data for it, so it could not decode that publication or any after it. Now the first publication after such a subscribe is sent with full data (centrifugal/centrifuge#629).
- Align fossil deltas to UTF-8 character boundaries for JSON clients centrifugal/centrifuge#630. For a change inside a multi-byte character it copies the first bytes of the character from the previous data and inserts the rest. The inserted bytes aren't valid UTF-8, json.Escape replaces them with U+FFFD, and the client fails to apply the delta. The fix eliminates this.
Miscellaneous
- This release is built with Go 1.26.8.
- Dependency updates.
- See also the corresponding Centrifugo PRO release.
v6.9.5
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
Improvements
- Slightly less work when recording
centrifugo_client_ping_pong_duration_secondsâ the histogram observer is now cached instead of being looked up on every pong.
Fixes
- Fix possible panic in the channel options cache on long-running nodes. Its internal counter overflowed
int32after enough cache misses, which gave a negative slot index and crashed the node withindex out of range(#1227). - Map subscriptions: the subscribe reply did not include
expires/ttl, so clients could not refresh the subscription token in time. Also, if the map state was loaded in several pages, the client's subscription refresh was rejected with abad requestdisconnect. A subscription whose expiration time was already in the past was accepted (centrifugal/centrifuge#626). allowed_originspatterns with upper-case letters (e.g.https://App.Example.com) never matched, because the requestOriginwas lower-cased before matching and the pattern was not. Patterns are now matched case-insensitively (#1230).client_namewas ignored for Redis used byredis_streamasync consumers (#1229).- PostgreSQL engine: handle one more case of several nodes creating the schema at the same time â a node could fail on start with
type ... already exists(SQLSTATE42710) (#1231). - The
centrifugo_client_subscriptions_acceptedmetric was registered but never incremented, so it always showed zero (centrifugal/centrifuge#622). - The
client closed or unsubscribed after adding subscriptionmessage is now logged atinfolevel instead oferror. It happens when a client goes away while its subscription is still being set up â this is expected and is not a server error (centrifugal/centrifuge#621).
Miscellaneous
- Weâve updated the official Centrifugo dashboard. It covers all exposed metrics in v6.9.4, avoids deprecated Prometheus summaries, and includes descriptions for all panels. You can download it from grafana.com. See also Centrifugo's observability docs
- This release is built with Go 1.26.8.
- Dependency updates.
- See also the corresponding Centrifugo PRO release.
v6.9.4
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
Improvements
- New
centrifugo_transport_frame_sizemetric â a histogram of frame sizes received from client connections. One frame may contain several commands, so this can't be calculated from the existing per-command counters. Helps to choose a good value forwebsocket.message_size_limit, which is applied to the whole frame (centrifugal/centrifuge#620). - Faster Protobuf client protocol command encoding: ~2.1x faster and ~55% less memory alloc
- Less work on every client command: config accessors and the channel options cache no longer copy structs on each call (#1215).
- PostgreSQL broker, map broker and controller now validate
table_prefixon start. A prefix with a hyphen, space or dot used to produce a confusing syntax error inside a generatedCREATEstatement (#1223).
Fixes
- Async consumers: a
context.Cancelederror returned by the message dispatcher was treated as a shutdown signal. In the Kafka consumer this could skip records and then commit an offset after them, losing messages. This did not happen right now in Centrifugo, but inaccurately introduced code could cause this in the future. Fixed for Kafka and SQS (#1221). - fix(pgoutbox): tolerate 42P07 when another node creates the partition first #1220. Thanks to @AlexeyShalaev for bringing and fixing this.
- PostgreSQL engine: handle the case when several nodes create the schema at the same time. Before that a node which lost the race could fail to start with
error initializing Postgres ... schema. - PostgreSQL map broker: the fast path in
EnsureSchemanever worked, so every node start ran the full DDL batch again. It works now and also refreshes the partition lookahead (#1223). - Fix a race in log throttling of the connection limit check â it could print many duplicate warnings instead of one per throttle interval (#1214).
- Some config validation errors mentioned keys which don't exist, so it was hard to find the option to fix (#1213).
- Admin web UI: fix uptime formatting on the Status page (centrifugal/web#71).
Miscellaneous
- This release is built with Go 1.26.8.
- Dependency updates.
- See also the corresponding Centrifugo PRO release.
New Contributors
- @AlexeyShalaev made their first contribution in #1220
Full Changelog: v6.9.3...v6.9.4
v6.9.3
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
Improvements
- Faster and less allocating decoding of client commands. The command decoders are on the hot path â one is taken from the pool for every frame a client sends. The JSON decoder now reuses its buffered reader instead of allocating a new 4KB buffer per frame, and returns commands without allocating a slice per command when they fit into the read buffer. The Protobuf decoder unmarshals small messages straight out of the buffered reader instead of copying them into a scratch buffer first. Decoding a frame with a single JSON command got 62% faster with 93% less memory allocated, a frame with 8 commands â 25% faster with 67% less memory; for Protobuf the win is around 7-10% in time (centrifugal/protocol#41).
- The message size limit is now applied to every command in a JSON frame. Previously it was only checked reliably for the first command, so subsequent commands in the same frame could exceed the configured limit (up to roughly twice it). A command of exactly the limit is still accepted wherever it sits in the frame (centrifugal/protocol#41).
Fixes
- Fix
client.connection_rate_limit: the configured value was used as the token bucket burst only, while the sustained rate was one connection per second. Centrifugo now accepts the configured number of new connections per second, keeping the configured value as the burst size too. Thanks to @moses-mbaga for the fix (#1207). - Shared poll:
hmac_previous_secret_key_valid_untilwas compared against theiatclaim carried inside the track signature. That value is chosen by whoever mints the signature, so anyone retaining the rotated-out key could keep producing accepted signatures indefinitely by backdatingiat. The cutoff is now enforced against server time before consulting the previous verifier â the same way it works for the previous JWT HMAC key â with theiatcheck kept as an additional constraint inside the grace period (#1209). - Apply
publication_data_formaton all publication paths. It was only enforced for stream publishes (API publish, API broadcast, client publish), so map publish, shared poll publish and client map publish stored whatever bytes the caller sent. Data returned by publish, map publish and shared poll refresh proxies is now validated as well â a proxy can replace the data a client sent, and a shared poll refresh result reaches subscribers without ever passing through a client (#1210).
Miscellaneous
- This release is built with Go 1.26.7.
- Dependency updates.
- See also the corresponding Centrifugo PRO release.
New Contributors
- @moses-mbaga made their first contribution in #1207
Full Changelog: v6.9.2...v6.9.3