Nchan is a scalable pub/sub server built as a module for Nginx that handles HTTP, WebSocket, long-polling, and EventSource connections across multiple worker processes and servers.
The tool solves the problem of distributing real-time messages to large numbers of concurrent subscribers by acting as a dedicated pub/sub layer between applications and clients. It accepts published messages via HTTP POST or WebSocket and delivers them to subscribers through multiple protocols including WebSocket, EventSource, long-polling, interval polling, and HTTP chunked transfer. Messages can be buffered in memory, on disk, or via Redis, with configurable per-channel delivery guarantees including no-repeat and no-loss semantics. All connections are handled asynchronously and distributed across worker processes, with optional Redis integration enabling horizontal scaling across multiple Nginx servers.
It works well when you need protocol flexibility—supporting both modern WebSocket and older long-polling clients from a single endpoint—and when you want introspection capabilities like channel event monitoring and performance statistics. The tool is particularly valuable as a shim between applications and subscribers, allowing you to scale the pub/sub layer independently. A browser-based subscriber library is available that handles protocol negotiation and resumable connections automatically.
Development on the project shows consistent maintenance with regular releases and documented changelog entries. The codebase demonstrates attention to backwards compatibility, with explicit documentation of deprecated features from its predecessor. The project maintains comprehensive documentation covering configuration, API usage, and upgrade paths, alongside performance benchmarking data that measures message delivery latency at scale.