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.

16 stars

Best use case

nchan-expert is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

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.

Teams using nchan-expert should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/nchan-expert/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/testing-security/nchan-expert/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/nchan-expert/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How nchan-expert Compares

Feature / Agentnchan-expertStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

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.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# 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](https://nchan.io).

## 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](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](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](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](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](references/docker.md) for the Dockerfile pattern and configuration.

## Resources

- **[references/directives.md](references/directives.md)**: Comprehensive list of configuration directives.
- **[references/variables.md](references/variables.md)**: Nchan-specific Nginx variables.
- **[references/security.md](references/security.md)**: Security and authorization patterns.
- **[references/storage.md](references/storage.md)**: Memory and Redis storage configuration.
- **[references/testing.md](references/testing.md)**: Minimal testing patterns with curl (stats, pub/sub, wss) and handshake troubleshooting.
- **[references/docker.md](references/docker.md)**: Docker containerization and multi-stage build patterns.

Related Skills

n8n-mcp-tools-expert

16
from diegosouzapw/awesome-omni-skill

Expert guide for using n8n-mcp MCP tools effectively. Use when searching for nodes, validating configurations, accessing templates, managing workflows, or using any n8n-mcp tool. Provides tool sele...

fdc-expert

16
from diegosouzapw/awesome-omni-skill

Expert on NEC µPD765 Floppy Disk Controller for ES-1841. Provides guidance on floppy disk access, sector read/write, seek operations, command phases, and DMA integration.

bluetooth-trainer-expert

16
from diegosouzapw/awesome-omni-skill

Expert guidance on reverse-engineering, testing, and integrating Bluetooth Smart Trainers (Wahoo/FTMS) for fitness applications. Use when building or debugging cycling apps.

testing-expert

16
from diegosouzapw/awesome-omni-skill

Elite KMP testing expertise covering unit tests, presenter testing with Turbine, screenshot tests with Compose Preview Screenshot Testing/Roborazzi/Paparazzi, repository tests, and test architecture. Use when writing tests, designing test strategies, setting up test infrastructure, or debugging test failures. Triggers on test creation, test patterns, fake implementations, or test infrastructure questions.

mqtt-expert

16
from diegosouzapw/awesome-omni-skill

Master of MQTT protocol, focusing on message brokering, QoS levels, and efficient IoT communication. Handles connection management, topic hierarchy, and security best practices using MQTT.

crypto-expert

16
from diegosouzapw/awesome-omni-skill

Crypto best-practices guidance and review across languages and domains. Use whenever cryptography, encryption, hashing, signatures, key/nonce/IV handling, randomness, password storage, TLS/PKI, secure channels, token formats, or "roll your own crypto" is mentioned, including high-level questions or code/design reviews. Trigger broadly to prevent subtle security mistakes.

appsec-expert

16
from diegosouzapw/awesome-omni-skill

Elite Application Security engineer specializing in secure SDLC, OWASP Top 10 2025, SAST/DAST/SCA integration, threat modeling (STRIDE), and vulnerability remediation. Expert in security testing, cryptography, authentication patterns, and DevSecOps automation. Use when securing applications, implementing security controls, or conducting security assessments.

anchor-expert-2026

16
from diegosouzapw/awesome-omni-skill

Expert Anchor smart contract development for Solana (January 2026). Use when (1) Writing or auditing Solana programs, (2) Implementing security patterns, (3) Defining account structures and constraints, (4) Building CPI interactions, (5) Testing with Mollusk/LiteSVM, (6) Deploying programs, or any Anchor/Solana program development questions.

agent-qa-expert

16
from diegosouzapw/awesome-omni-skill

Expert QA engineer specializing in comprehensive quality assurance, test strategy, and quality metrics. Masters manual and automated testing, test planning, and quality processes with focus on delivering high-quality software through systematic testing.

AI Integration Expert

16
from diegosouzapw/awesome-omni-skill

Work with Leavn AI features - UnifiedAIService, on-device models, devotional generation, novelization, kids mode, image generation with Stable Diffusion

ai-engineer-expert

16
from diegosouzapw/awesome-omni-skill

Expert-level AI implementation, deployment, LLM integration, and production AI systems

ai-architect-expert

16
from diegosouzapw/awesome-omni-skill

Expert-level AI system design, MLOps, architecture patterns, and AI infrastructure