nchan-expert

📁 tailuge/nchan-expert 📅 Jan 28, 2026
4
总安装量
2
周安装量
#50927
全站排名
安装命令
npx skills add https://github.com/tailuge/nchan-expert --skill nchan-expert

Agent 安装分布

gemini-cli 2
github-copilot 2
kode 1
claude-code 1
windsurf 1
zencoder 1

Skill 文档

Nchan Expert

Overview

This skill provides procedural knowledge for configuring, optimizing, and securing Nchan, the high-performance pub/sub module for Nginx.

Core Capabilities

1. Endpoint Configuration

Nchan maps Nginx locations to pub/sub endpoints.

  • Publishers: Use nchan_publisher to create endpoints that accept messages via HTTP POST or Websockets.
  • Subscribers: Use nchan_subscriber to support Websocket, EventSource (SSE), Long-Polling, and more.
  • PubSub: Use nchan_pubsub for locations that act as both.

2. Scalability & Storage

Nchan supports local memory storage and Redis for horizontal scaling.

  • Redis Modes: Distributed (shared), Backup (persistence), and Nostore (broadcast).
  • Redis Cluster: High availability and sharding support.
  • See references/storage.md for details.

3. Security & Access Control

Secure your channels using various patterns:

  • Authorization: nchan_authorize_request for delegating auth to an upstream application.
  • Internal Redirects: X-Accel-Redirect for hiding channel IDs.
  • ACLs: Standard Nginx allow/deny for publisher endpoints.
  • See references/security.md for implementation patterns.

4. Advanced Messaging Features

  • Multiplexing: Subscribe to up to 255 channels over one connection.
  • Channel Groups: Use nchan_channel_group for accounting and namespace isolation.
  • Upstream Hooks: nchan_publisher_upstream_request for mutating messages before they are published.

5. Monitoring & Introspection

  • Stub Status: nchan_stub_status for real-time metrics.
  • Channel Events: nchan_channel_events_channel_id for debugging channel lifecycle events.
  • Variables: Use Nchan-specific variables like $nchan_channel_id and $nchan_subscriber_count.
  • See references/variables.md for a full list.

Resources