nchan-expert

Expert guidance for Nchan, a scalable pub/sub server for Nginx. Use this skill when you need to configure Nchan endpoints (publisher/subscriber), set up horizontal scaling with Redis, implement security patterns (authorization, X-Accel-Redirect), or troubleshoot Nchan performance and metrics.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "nchan-expert" with this command: npx skills add tailuge/nchan-expert/tailuge-nchan-expert-nchan-expert

Nchan Expert

Overview

This skill provides procedural knowledge for configuring, optimizing, and securing Nchan, the high-performance pub/sub module for Nginx. It is based on the core Nchan documentation.

Core Capabilities

1. Endpoint Configuration

Map 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

Configure local memory storage and Redis for horizontal scaling.

  • Redis Modes: Implement Distributed (shared), Backup (persistence), or Nostore (broadcast) modes.
  • Redis Cluster: Set up high availability and sharding.
  • See references/storage.md for implementation details.

3. Security & Access Control

Secure channels using standardized patterns:

  • Authorization: Use nchan_authorize_request to delegate auth to an upstream application.
  • Internal Redirects: Implement X-Accel-Redirect to hide internal channel IDs.
  • ACLs: Apply standard Nginx allow/deny directives for publisher endpoints.
  • See references/security.md for patterns.

4. Advanced Messaging Features

  • Multiplexing: Subscribe to up to 255 channels over a single connection.
  • Channel Groups: Use nchan_channel_group for accounting and namespace isolation.
  • Upstream Hooks: Use nchan_publisher_upstream_request to mutate messages before publication.

5. Monitoring & Introspection

  • Stub Status: Monitor real-time metrics via nchan_stub_status.
  • Channel Events: Track channel lifecycle events for debugging.
  • Variables: Utilize Nchan-specific variables like $nchan_channel_id and $nchan_subscriber_count.
  • See references/variables.md for the full reference.

6. Testing & Validation

  • Verify Handshakes: Use curl with --http1.1 and a valid 16-byte Sec-WebSocket-Key.
  • Troubleshoot: Resolve issues with HTTP/2 negotiation and strict proxy key enforcement (e.g., Cloudflare/Render).
  • See references/testing.md for commands and troubleshooting steps.

7. Containerization

  • Compile Module: Use multi-stage builds to compile Nchan for Nginx Alpine.
  • Harden Security: Run as a non-root user and implement container healthchecks.
  • See references/docker.md for the Dockerfile pattern and configuration.

Resources

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Security

compliance-evidence-assembler

把审计所需证据整理成目录、清单和缺失项,便于后续评审。;use for compliance, evidence, audit workflows;do not use for 伪造证据, 替代正式审计结论.

Archived SourceRecently Updated
Security

skillguard-hardened

Security guard for OpenClaw skills, developed and maintained by rose北港(小红帽 / 猫猫帽帽). Audits installed or incoming skills with local rules plus Zenmux AI intent review, then recommends pass, warn, block, or quarantine.

Archived SourceRecently Updated
Security

api-contract-auditor

审查 API 文档、示例和字段定义是否一致,输出 breaking change 风险。;use for api, contract, audit workflows;do not use for 直接改线上接口, 替代契约测试平台.

Archived SourceRecently Updated
Security

ai-workflow-red-team-lite

对 AI 自动化流程做轻量红队演练,聚焦误用路径、边界失败和数据泄露风险。;use for red-team, ai, workflow workflows;do not use for 输出可直接滥用的攻击脚本, 帮助破坏系统.

Archived SourceRecently Updated