Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

sockudo

> 编程语言
Open source

Blazingly fast pusher drop-in replacement written in rust

793 stars0 likes1 views
WebsiteGitHub

About

Blazingly fast pusher drop-in replacement written in rust

Sockudo

A self-hosted realtime platform: Pusher-compatible at the edge, Sockudo-native where you need recovery, history, mutable messages, push, AI Transport, and first-party SDKs.

What Sockudo Is

Sockudo is a high-performance Rust realtime server for WebSocket and HTTP publish workloads. It keeps strict Protocol V1 compatibility with the Pusher protocol, then adds Protocol V2 features for teams that need stronger delivery semantics and product-level control.

This repository is now the Sockudo monorepo. It contains the server, Rust workspace crates, dashboard, deployment assets, docs, official realtime client SDKs, HTTP server SDKs, and the TypeScript AI Transport SDK.

Highlights

  • Pusher-compatible WebSocket and HTTP APIs for Protocol V1 clients.
  • Protocol V2 with sockudo: events, serials, message IDs, recovery, rewind, tags, deltas, and mutable message events.
  • Horizontal fanout through Redis, Redis Cluster, NATS, RabbitMQ, Google Pub/Sub, Kafka, Pulsar, and Apache Iggy.
  • Durable history, hot replay buffers, two-tier recovery, until_attach history reads, and degraded/reset-required continuity state.
  • Versioned mutable messages with create, update, delete, append, summary, latest-visible reads, and version history.
  • Presence membership plus retained presence-history transitions and snapshots.
  • Message annotations for reactions, receipts, moderation, summary projection, and raw annotation streams.
  • Push notification pipeline for FCM, APNs, Web Push, HMS, and WNS.
  • Prometheus metrics, webhook delivery, rate limiting, app managers, TLS, Docker Compose, and Helm.
  • Optional AI Transport built on the same versioned-message, history, recovery, push, and presence primitives instead of a parallel streaming path.
  • Optional ably-compat facade exposing a reduced Ably AI Transport compatibility surface for tested AI Transport workloads.

Monorepo Layout

…

The SDK directories preserve their original repository names so package metadata, release scripts, and issue references remain recognizable.

Protocols

Capability Protocol V1 Protocol V2
Event prefixes pusher: / pusher_internal: sockudo: / sockudo_internal:
Pusher compatibility Strict compatibility target Sockudo-native
serial and message_id Stripped from delivery Native on relevant frames
Recovery and rewind Not available Hot replay plus durable history
Mutable messages Not available sockudo:message.*
Annotations Not available Native
Tag filtering and deltas Not available Native
AI Transport Not available Optional feature and runtime config

Use Protocol V1 when you need drop-in Pusher behavior. Use Protocol V2 when clients and server SDKs can rely on Sockudo-native recovery, history, mutation, annotation, filtering, and AI Transport semantics. Protocol defaults vary by SDK; check each package README before assuming V2 is enabled.

Quick Start

Docker Compose

bash
git clone https://github.com/sockudo/sockudo.git
cd sockudo
make up

Default local services:

Service URL
Sockudo server http://localhost:6001
Prometheus metrics http://localhost:9601/metrics
Dashboard UI http://localhost:5174
Dashboard API http://localhost:3460

Linux Binary

Install the latest verified x86_64 or ARM64 release into ~/.local/bin:

bash
curl --proto '=https' --tlsv1.2 -sSfL \
  https://sockudo.io/install.sh | sh

The installer detects GNU libc or musl and verifies the archive's SHA-256 checksum. See the installation guide for version pinning and custom installation paths.

From Source

bash
rustup toolchain install stable
git clone https://github.com/sockudo/sockudo.git
cd sockudo

cargo run -p sockudo

Build with a production-oriented feature set:

bash
cargo build -p sockudo --release --features "v2,redis,postgres,push"

Build everything the server can expose:

bash
cargo build -p sockudo --release --features full

Kubernetes

bash
helm install sockudo oci://ghcr.io/sockudo/charts/sockudo --version 4.7.0

Or from a checkout, when developing the chart itself:

bash
helm install sockudo ./charts/sockudo

Example production shape with Redis, ingress, autoscaling, and monitoring:

bash
helm install sockudo oci://ghcr.io/sockudo/charts/sockudo --version 4.7.0 \
  --set config.adapterDriver=redis \
  --set redis.host=redis-master \
  --set redis.existingSecret=my-redis-secret \
  --set defaultApp.existingSecret=my-default-app-secret \
  --set autoscaling.enabled=true \
  --set pdb.enabled=true \
  --set ingress.enabled=true \
  --set serviceMonitor.enabled=true

When defaultApp.existingSecret is set, the Secret must contain default-app-secret and can also include default-app-id and default-app-key.

Client SDKs

Realtime clients live under client-sdks/.

SDK CI and publishing are managed from root workflows. See the 2026 SDK publishing runbook before releasing packages or changing registry setup. Registry-native packages publish through protected workflows where supported. SwiftPM packages are mirrored to standalone package repositories.

Runtime Package
JavaScript / TypeScript @sockudo/client
AI Transport TypeScript @sockudo/ai-transport
Swift / Apple platforms SockudoSwift via SwiftPM (https://github.com/sockudo/sockudo-swift)
Kotlin / JVM / Android io.sockudo:sockudo-kotlin
Flutter / Dart sockudo_flutter
.NET Sockudo.Client
Python sockudo-python

JavaScript example:

typescript
import Sockudo from "@sockudo/client";

const sockudo = new Sockudo("app-key", {
  wsHost: "127.0.0.1",
  wsPort: 6001,
  wssPort: 6001,
  forceTLS: false,
  enabledTransports: ["ws"],
  protocolVersion: 2,
});

const channel = sockudo.subscribe("public-updates");
channel.bind("price-updated", (payload) => {
  console.log(payload);
});

AI Transport example:

typescript
import { ClientSessionProvider, useView } from "@sockudo/ai-transport/react";

See client-sdks/sockudo-ai-transport-js/README.md for React, Vue, Svelte, Vercel AI SDK, and direct provider helpers.

Server SDKs

HTTP/server SDKs live under server-sdks/. They publish events, sign private and presence channel auth, authenticate users, validate webhooks, query state, and expose Sockudo-native APIs such as idempotent publishing, history, mutable messages, annotations, and push where implemented.

SDK CI and publishing are managed from root workflows. See the 2026 SDK publishing runbook before releasing packages or changing registry setup. Registry-native packages publish through protected workflows where supported. Go modules and SwiftPM publish from this monorepo with package-manager-native tags and manifests. The PHP SDK is mirrored to sockudo/sockudo-http-php for Packagist.

Language Package
Node.js sockudo
Python sockudo-http-python
PHP sockudo/sockudo-php-server
Ruby sockudo
Go github.com/sockudo/sockudo/server-sdks/sockudo-http-go/v2
Rust sockudo-http
Java io.sockudo:sockudo-http-java
.NET SockudoServer
Swift Sockudo via SwiftPM (https://github.com/sockudo/sockudo-http-swift)

Node.js example:

typescript
import { Sockudo } from "sockudo";

const sockudo = new Sockudo({
  appId: "app-id",
  key: "app-key",
  secret: "app-secret",
  host: "127.0.0.1",
  port: 6001,
  useTLS: false,
});

await sockudo.trigger("orders", "order.created", { id: "ord_123" });

Python example:

python
from sockudo_http import Config, Sockudo

sockudo = Sockudo(
    Config(
        app_id="app-id",
        key="app-key",
        secret="app-secret",
        host="127.0.0.1",
        port=6001,
    )
)

sockudo.trigger("orders", "order.created", {"id": "ord_123"})

Server Workspace

The Rust workspace is split by responsibility:

Crate Responsibility
sockudo-protocol Protocol message types, V1/V2 prefixes, extras, wire payloads
sockudo-filter Tag filtering expressions and matching
sockudo-core Shared traits, config, auth, errors, history, version store, annotations
sockudo-app App-manager backends
sockudo-cache Cache backends
sockudo-queue Queue backends
sockudo-rate-limiter Rate limiting and middleware
sockudo-metrics Prometheus metrics
sockudo-webhook Webhook delivery
sockudo-delta Delta compression
sockudo-push Push domain, storage, queues, providers, feedback, scheduler
sockudo-ai-transport AI Transport validation, rollup, and conformance helpers
sockudo-adapter Connections, presence, fanout, replay, recovery
sockudo-mcp Model Context Protocol server (tools, resources, prompts) and sockudo-mcp binary
sockudo-server Binary, HTTP/WS routes, bootstrap, durable stores, push API

The Rust SDK at server-sdks/sockudo-http-rust is intentionally excluded from the root Cargo workspace so it can keep its own package and release lifecycle.

Feature Flags

Common server features:

Feature Purpose
local In-memory development defaults
v2 Protocol V2 bundle: deltas, tag filtering, recovery
delta Delta compression
tag-filtering Server-side tag filtering
recovery Serial and message-id recovery
ai-transport AI Transport validation and rollup surfaces
ably-compat Opt-in reduced Ably Realtime/REST facade for AI Transport compatibility; implies ai-transport
push Push notification runtime and HTTP APIs
mcp Embedded Model Context Protocol server for AI agents (/mcp, scoped bearer tokens)
redis, redis-cluster Redis-backed adapter/cache/queue/rate limit paths
nats, pulsar, rabbitmq, google-pubsub, kafka, iggy Horizontal adapter and queue integrations
omq Brokerless horizontal adapter integration
mysql, postgres, dynamodb, surrealdb, scylladb App, history, version-store, and push storage backends
sqs, sns, lambda AWS queue, notification, and webhook integrations
full All production integrations wired by the server

Examples:

bash
cargo build
cargo build --no-default-features
cargo build --features "redis,postgres"
cargo build --features "v2,ai-transport,redis,postgres,push"
cargo build --release --features full

Configuration

Sockudo prefers TOML and falls back to JSON. The default local config is config/config.toml.

Minimal local shape:

toml
port = 6001
host = "0.0.0.0"
debug = false

[app_manager]
driver = "memory"

[app_manager.array]
[[app_manager.array.apps]]
id = "app-id"
key = "app-key"
secret = "app-secret"
enabled = true

[adapter]
driver = "local"

[cache]
driver = "memory"

[queue]
driver = "memory"

Major runtime sections:

Section Purpose
[app_manager] App credentials, policies, origin rules, namespaces
[adapter] Realtime fanout driver
[cache] Shared cache for auth, recovery, and cross-node state
[queue] Background queue driver
[history] Durable channel history
[versioned_messages] Mutable message storage and versioning
[presence_history] Retained join/leave transitions
[annotations] Annotation publish, delete, summaries, raw streams
[push] Push providers, quotas, retries, feedback, scheduler
[ai_transport] AI Transport validation and channel scoping

Reference docs:

  • Deployment guide
  • Static configuration
  • [

Issues· 12 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rustabblybroadcastingpusherrealtime

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言