百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

sockethub

> 数据库
开源

使用 ActivityStream 消息的多协议网关。

393 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

使用 ActivityStream 消息的多协议网关。

Sockethub

A protocol gateway for the web. Sockethub lets browser apps talk to IRC, XMPP, feeds, and other protocols using one ActivityStreams JSON format. Your app sends a single message shape, and Sockethub handles connections, credentials, and protocol translation.

What You Can Do

  • Send and receive chat messages (IRC, XMPP)
  • Fetch and parse feeds (RSS, Atom)
  • Generate link previews and metadata
  • Add new protocols as custom platforms

ActivityStreams In/Out

Sockethub uses ActivityStreams JSON for all platforms. Your app sends the same shape for IRC, XMPP, feeds, and more, and receives the same shape back. Only the @context changes.

Side-by-side Examples

The @context selects a platform; the rest stays consistent.

About

Sockethub is a translation layer for web applications to communicate with protocols and services that are impractical to use from in-browser JavaScript. It runs server-side, keeps long-lived connections, and exposes everything as ActivityStreams JSON.

Built with modern TypeScript and running on Node.js, Sockethub is organized as a monorepo with packages for the server, client, schemas, and platforms. (Development uses Bun as the toolchain; see Contributing.)

Originally inspired as a sister project to RemoteStorage, and assisting in the development of unhosted and noBackend, Sockethub also fits into traditional stacks by removing protocol-specific code from the application layer.

Architecture

Sockethub runs each protocol in its own process and moves messages through Redis so browsers can talk to long-lived connections safely.

  • Main Server (packages/server/) - Socket.IO, validation, routing
  • Platform Processes - One process per protocol
  • Job Queue - Redis-backed BullMQ between server and platforms
  • Data Layer - Encrypted credentials and session state in Redis

Request Flow:

  1. Client connects via Socket.IO
  2. Message validated and routed
  3. Credentials are encrypted and stored per session in Redis
  4. Message queued to platform
  5. Platform responds via Socket.IO

For detailed architecture documentation, see Architecture.

Documentation

  • Documentation Hub - Complete documentation index and guides
  • Getting Started - Installation and quick start
  • Client Guide - Browser client library usage
  • Platform Development - Creating custom platforms
  • Architecture - Technical architecture overview
  • Configuration - Server configuration options
  • Contributing - Developer workflow and commands
  • Performance Testing - Load testing and benchmarking

Capabilities

Sockethub standardizes platform actions as ActivityStreams type values. For example, an XMPP friend request can be modeled as request-friend, remove-friend, and make-friend in a consistent format.

Included Platforms

  • CardDAV - Address-book and contact synchronization
  • CalDAV - Calendar and task synchronization
  • Feeds - RSS and Atom feed processing
  • IRC - Internet Relay Chat protocol support
  • XMPP - Extensible Messaging and Presence Protocol
  • Metadata - Link preview and metadata extraction

Build Your Own

Create a platform module that defines a schema and maps ActivityStreams verbs. Enable or disable platforms in config.json.

  • Dummy - Example platform for developers
  • Platform Development docs - Full guide

Quick Start

Requirements

  • Node.js v20+ (Sockethub runs on Node.js)
  • Redis (data layer and job queue)

Install & Run

bash
# Start Redis (required for data layer)
# - Docker: docker run -d -p 6379:6379 redis:alpine
# - Homebrew: brew install redis && brew services start redis

# Install and run the server (Node.js)
npm install -g sockethub
sockethub --help
sockethub --host 0.0.0.0

Or run with Docker (docker compose up sockethub), which builds and runs the server on Node.js.

Develop from source

Contributors use Bun as the toolchain. See Contributing for the full workflow.

bash
bun install        # install workspace dependencies
bun run dev        # dev server with examples, HTTP actions, and hot reload

Open http://localhost:10550 for the interactive examples.

Environment Variables

For debugging and configuration options, see the Server package documentation.

Packages

Core Infrastructure

  • sockethub - Main meta-package for installing Sockethub
  • @sockethub/client - Browser client library for connecting to Sockethub
  • @sockethub/data-layer - Redis-based job queue and credential storage
  • @sockethub/schemas - ActivityStreams validation and TypeScript types
  • @sockethub/server - Core server implementation with Socket.IO interface

Libraries

  • @sockethub/irc2as - IRC to ActivityStreams translation
  • @sockethub/logger - Winston-based logger with global configuration
  • @sockethub/util - Shared utilities (crypto, networking/SSRF, error helpers)

Platform Implementations

  • @sockethub/platform-dummy - Example platform for development reference
  • @sockethub/platform-carddav - Address-book and contact synchronization
  • @sockethub/platform-caldav - Calendar and task synchronization
  • @sockethub/platform-feeds - RSS and Atom feed processing
  • @sockethub/platform-irc - IRC protocol support
  • @sockethub/platform-metadata - Link preview and metadata extraction
  • @sockethub/platform-xmpp - XMPP protocol support

Example Package

  • @sockethub/examples - Example client app (served with sockethub --examples)

Credits

Project created and maintained by Nick Jennings

Logo design by Jan-Christoph Borchardt

Sponsored by NLNET

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptactivity-objectactivity-streamircjavascript

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类数据库
定价开源

> 相关工具

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库