MCPSERV.CLUB
ZNC

ZNC

Self-Hosted

Advanced IRC bouncer for persistent chat sessions

Active(94)
2.1kstars
0views
Updated 17 days ago
ZNC screenshot 1
1 / 4

Overview

Discover what makes ZNC powerful

ZNC is a lightweight, event‑driven IRC bouncer written in **C++17** that sits between an IRC client and one or more IRC networks. Its core purpose is to maintain a persistent connection, allowing users to disconnect and reconnect without losing chat history or channel state. The daemon exposes a **web‑based administration interface**, an IRC command set, and a **plugin API** that lets developers extend functionality or integrate with external services. ZNC is distributed under the GPLv3, making it attractive for self‑hosted deployments that require full control over code and data.

Persistent channel state

Multi‑network support

Modular architecture

Web interface

Overview

ZNC is a lightweight, event‑driven IRC bouncer written in C++17 that sits between an IRC client and one or more IRC networks. Its core purpose is to maintain a persistent connection, allowing users to disconnect and reconnect without losing chat history or channel state. The daemon exposes a web‑based administration interface, an IRC command set, and a plugin API that lets developers extend functionality or integrate with external services. ZNC is distributed under the GPLv3, making it attractive for self‑hosted deployments that require full control over code and data.

Key Features

  • Persistent channel state: Keeps users in channels, preserves modes, and buffers messages for offline periods.
  • Multi‑network support: A single ZNC instance can manage dozens of networks per user.
  • Modular architecture: Core functionality is split into modules (e.g., modperl, modpython, cyrusauth), each compiled as a shared library.
  • Web interface: Built on the lightweight Crow web framework, providing real‑time configuration and monitoring.
  • Extensive logging & metrics: JSON log output, Prometheus‑style counters, and a configurable verbosity level.

Technical Stack

LayerTechnology
Core daemonC++17, Boost (filesystem, locale), OpenSSL/TLS, libevent
Build systemCMake 3.13+, GNU Make, optional SWIG for language bindings
ModulesDynamic libraries (*.so/*.dll) written in C++, Perl, Python, or custom languages via SWIG
Web UICrow (embedded web server), HTML/CSS/JS, optional React for advanced dashboards
PersistenceFlat‑file SQLite (optional), or custom key/value store; configuration stored in ~/.znc/znc.conf
PackagingNative packages for Debian, Fedora, FreeBSD, macOS; Docker images available

Core Capabilities

  • API surface: Each module exposes a set of exported functions (ZNCMODULE_init, ZNCMODULE_deinit) and can register IRC hooks (e.g., onMessage, onUserConnect).
  • Event loop: ZNC uses a single threaded event loop powered by libevent, ensuring deterministic latency for message delivery.
  • Plugin extensibility: Developers can write modules in C++ or embed scripting languages (Perl, Python). The module loader dynamically resolves symbols and injects configuration via a znc::Config object.
  • Webhooks & callbacks: Modules can expose HTTP endpoints or subscribe to Prometheus metrics, enabling integration with CI/CD pipelines or monitoring stacks.

Deployment & Infrastructure

ZNC is intentionally minimalistic: a single binary plus optional modules, making it ideal for containerized environments. The standard Docker image (znc/znc:latest) mounts a /config volume for persistence and exposes ports 6667 (IRC) and 8080 (web UI). For scaling, multiple ZNC instances can be load‑balanced behind a reverse proxy; each instance handles its own users, reducing contention. High availability can be achieved with Kubernetes StatefulSets and persistent volumes, while the lightweight footprint keeps resource usage under 50 MiB of RAM for a typical instance.

Integration & Extensibility

  • Module ecosystem: The official repository hosts dozens of community modules (e.g., modflood, modlog).
  • Scripting hooks: The Python and Perl modules allow quick automation—send notifications to Slack, log events to ElasticSearch, or enforce custom policies.
  • Web API: The web UI can be programmatically accessed via CSRF‑protected REST endpoints, enabling external dashboards or bots.
  • Custom protocols: By writing a new module that implements the IRC client interface, developers can route traffic through proxies or VPNs transparently.

Developer Experience

ZNC’s documentation is comprehensive, with a dedicated wiki covering build options, module authoring guides, and configuration examples. The source tree is well‑structured: src/ contains the daemon core, modules/ houses individual modules, and docs/ holds Markdown and Doxygen outputs. Community support is active on #znc (Libera.Chat) and the GitHub issue tracker, with frequent releases and CI coverage. The modular design lowers the barrier to entry for contributors: adding a new module requires only implementing a few exported functions and registering hooks.

Use Cases

  • Enterprise chat gateways: Organizations can run ZNC as an internal proxy, enforcing authentication via cyrusauth and logging all traffic.
  • Personal productivity: Developers who use multiple IRC clients benefit from a single persistent connection, ensuring they never miss a private message.
  • Bot hosting: Bots that need to stay online 24/7 can be run behind ZNC, which automatically reconnects on network outages.
  • Educational labs: In teaching courses about IRC or networking, students can experiment with modules without exposing real clients to the public internet.

Advantages Over Alternatives

CriterionZNCAlternative (e.g., Exim, UnrealIRCd)
PerformanceSingle‑threaded, event‑driven; low latencyOften multi‑process, higher overhead
ExtensibilityNative module API + scripting languagesLimited plugin support or requires full

Open SourceReady to get started?

Join the community and start self-hosting ZNC today