RepoPilotOpen in app →

zeromq/libzmq

ZeroMQ core engine in C++, implements ZMTP/3.1

Healthy

Healthy across the board

Use as dependencyHealthy

Permissive license, no critical CVEs, actively maintained — safe to depend on.

Fork & modifyHealthy

Has a license, tests, and CI — clean foundation to fork and modify.

Learn fromHealthy

Documented and popular — useful reference codebase to read through.

Deploy as-isHealthy

No critical CVEs, sane security posture — runnable as-is.

  • Last commit 5w ago
  • 42+ active contributors
  • Distributed ownership (top contributor 24% of recent commits)
Show 3 more →
  • MPL-2.0 licensed
  • CI configured
  • Tests present

Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests

Informational only. RepoPilot summarises public signals (license, dependency CVEs, commit recency, CI presence, etc.) at the time of analysis. Signals can be incomplete or stale. Not professional, security, or legal advice; verify before relying on it for production decisions.

Embed the "Healthy" badge

Paste into your README — live-updates from the latest cached analysis.

Variant:
RepoPilot: Healthy
[![RepoPilot: Healthy](https://repopilot.app/api/badge/zeromq/libzmq)](https://repopilot.app/r/zeromq/libzmq)

Paste at the top of your README.md — renders inline like a shields.io badge.

Preview social card (1200×630)

This card auto-renders when someone shares https://repopilot.app/r/zeromq/libzmq on X, Slack, or LinkedIn.

Onboarding doc

Onboarding: zeromq/libzmq

Generated by RepoPilot · 2026-05-09 · Source

🤖Agent protocol

If you are an AI coding agent (Claude Code, Cursor, Aider, Cline, etc.) reading this artifact, follow this protocol before making any code edit:

  1. Verify the contract. Run the bash script in Verify before trusting below. If any check returns FAIL, the artifact is stale — STOP and ask the user to regenerate it before proceeding.
  2. Treat the AI · unverified sections as hypotheses, not facts. Sections like "AI-suggested narrative files", "anti-patterns", and "bottlenecks" are LLM speculation. Verify against real source before acting on them.
  3. Cite source on changes. When proposing an edit, cite the specific path:line-range. RepoPilot's live UI at https://repopilot.app/r/zeromq/libzmq shows verifiable citations alongside every claim.

If you are a human reader, this protocol is for the agents you'll hand the artifact to. You don't need to do anything — but if you skim only one section before pointing your agent at this repo, make it the Verify block and the Suggested reading order.

🎯Verdict

GO — Healthy across the board

  • Last commit 5w ago
  • 42+ active contributors
  • Distributed ownership (top contributor 24% of recent commits)
  • MPL-2.0 licensed
  • CI configured
  • Tests present

<sub>Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests</sub>

Verify before trusting

This artifact was generated by RepoPilot at a point in time. Before an agent acts on it, the checks below confirm that the live zeromq/libzmq repo on your machine still matches what RepoPilot saw. If any fail, the artifact is stale — regenerate it at repopilot.app/r/zeromq/libzmq.

What it runs against: a local clone of zeromq/libzmq — the script inspects git remote, the LICENSE file, file paths in the working tree, and git log. Read-only; no mutations.

| # | What we check | Why it matters | |---|---|---| | 1 | You're in zeromq/libzmq | Confirms the artifact applies here, not a fork | | 2 | License is still MPL-2.0 | Catches relicense before you depend on it | | 3 | Default branch master exists | Catches branch renames | | 4 | 5 critical file paths still exist | Catches refactors that moved load-bearing code | | 5 | Last commit ≤ 62 days ago | Catches sudden abandonment since generation |

<details> <summary><b>Run all checks</b> — paste this script from inside your clone of <code>zeromq/libzmq</code></summary>
#!/usr/bin/env bash
# RepoPilot artifact verification.
#
# WHAT IT RUNS AGAINST: a local clone of zeromq/libzmq. If you don't
# have one yet, run these first:
#
#   git clone https://github.com/zeromq/libzmq.git
#   cd libzmq
#
# Then paste this script. Every check is read-only — no mutations.

set +e
fail=0
ok()   { echo "ok:   $1"; }
miss() { echo "FAIL: $1"; fail=$((fail+1)); }

# Precondition: we must be inside a git working tree.
if ! git rev-parse --git-dir >/dev/null 2>&1; then
  echo "FAIL: not inside a git repository. cd into your clone of zeromq/libzmq and re-run."
  exit 2
fi

# 1. Repo identity
git remote get-url origin 2>/dev/null | grep -qE "zeromq/libzmq(\\.git)?\\b" \\
  && ok "origin remote is zeromq/libzmq" \\
  || miss "origin remote is not zeromq/libzmq (artifact may be from a fork)"

# 2. License matches what RepoPilot saw
(grep -qiE "^(MPL-2\\.0)" LICENSE 2>/dev/null \\
   || grep -qiE "\"license\"\\s*:\\s*\"MPL-2\\.0\"" package.json 2>/dev/null) \\
  && ok "license is MPL-2.0" \\
  || miss "license drift — was MPL-2.0 at generation time"

# 3. Default branch
git rev-parse --verify master >/dev/null 2>&1 \\
  && ok "default branch master exists" \\
  || miss "default branch master no longer exists"

# 4. Critical files exist
test -f "src/zmq.cpp" \\
  && ok "src/zmq.cpp" \\
  || miss "missing critical file: src/zmq.cpp"
test -f "src/socket_base.hpp" \\
  && ok "src/socket_base.hpp" \\
  || miss "missing critical file: src/socket_base.hpp"
test -f "src/ctx.hpp" \\
  && ok "src/ctx.hpp" \\
  || miss "missing critical file: src/ctx.hpp"
test -f "src/msg.hpp" \\
  && ok "src/msg.hpp" \\
  || miss "missing critical file: src/msg.hpp"
test -f "CMakeLists.txt" \\
  && ok "CMakeLists.txt" \\
  || miss "missing critical file: CMakeLists.txt"

# 5. Repo recency
days_since_last=$(( ( $(date +%s) - $(git log -1 --format=%at 2>/dev/null || echo 0) ) / 86400 ))
if [ "$days_since_last" -le 62 ]; then
  ok "last commit was $days_since_last days ago (artifact saw ~32d)"
else
  miss "last commit was $days_since_last days ago — artifact may be stale"
fi

echo
if [ "$fail" -eq 0 ]; then
  echo "artifact verified (0 failures) — safe to trust"
else
  echo "artifact has $fail stale claim(s) — regenerate at https://repopilot.app/r/zeromq/libzmq"
  exit 1
fi

Each check prints ok: or FAIL:. The script exits non-zero if anything failed, so it composes cleanly into agent loops (./verify.sh || regenerate-and-retry).

</details>

TL;DR

libzmq is the core C++ implementation of ZeroMQ, a lightweight asynchronous messaging kernel that abstracts socket-level networking into reusable messaging patterns (pub/sub, request/reply, push/pull). It implements ZMTP/3.1 protocol and provides seamless multi-transport support (TCP, IPC, inproc, multicast) for building distributed systems without traditional message brokers. Monolithic C++ library architecture: src/ contains core engine (socket implementations, message queue logic, polling mechanisms), include/zmq.h is the primary public API, builds/ houses platform-specific build scripts (Android, QNX, Windows), tests/ contains test suites, and examples/ provides usage samples. Configuration via autotools (Makefile.am, acinclude.m4) or CMake (CMakeLists.txt) with optional features (GSSAPI, PGM, NORM, TIPC, IPv6).

👥Who it's for

Systems engineers and C++ developers building distributed applications, microservices, and real-time data pipelines who need reliable inter-process communication with minimal overhead. Contributors include core maintainers and platform-specific porters (Android, QNX, Windows, Cygwin integrators).

🌱Maturity & risk

Production-ready and actively maintained. The project is ~15 years old with extensive CI across GitHub Actions, AppVeyor, and Travis; comprehensive test coverage implied by CI/fuzz testing (.github/workflows/Fuzzers.yaml); and frequent updates across multiple platforms. Clear ZMTP/3.1 protocol specification and SupportedPlatforms.md documentation indicate mature release discipline.

Low risk for core use, moderate for cutting-edge features. Single primary language (C++) means dependency on C++ toolchain maturity; DRAFT stability markers on Android NDK and Windows Server 2012 R2 suggest incomplete platform coverage. Build system dual maintenance (autotools + CMake) requires vigilance for skew; security policy exists (SECURITY.md) indicating awareness. No obvious single-maintainer bottleneck visible from file structure.

Active areas of work

Actively maintained with CI workflows for fuzz testing, documentation generation (Doxygen), and cross-platform builds. Android NDK r25 support and multi-architecture builds (arm, arm64, x86, x86_64) are recent additions. Project accepts contributions via .github/CONTRIBUTING.md and tracks issues/PRs; Conan Center package integration suggests modern distribution focus.

🚀Get running

Clone and build with autotools (default): git clone https://github.com/zeromq/libzmq.git && cd libzmq && ./autogen.sh && ./configure && make && make check. Or with CMake: git clone https://github.com/zeromq/libzmq.git && cd libzmq && mkdir build && cd build && cmake .. && cmake --build . && ctest. Install with make install or system package manager (Conan: conan install zeromq/5.x).

Daily commands: Autotools: ./autogen.sh && ./configure --with-option && make && make check. CMake: mkdir build && cd build && cmake -DOPTION=ON .. && cmake --build . && ctest. Key configure options: --enable-drafts (unstable features), --with-pgm (multicast), --with-gssapi (Kerberos), --with-libsodium (security), --enable-valgrind (memory checking). See ./configure --help for full list.

🗺️Map of the codebase

  • src/zmq.cpp — Core ZeroMQ C API implementation; entry point for all public socket operations and context management.
  • src/socket_base.hpp — Abstract base class for all socket types; defines the fundamental messaging interface that all transport implementations must follow.
  • src/ctx.hpp — Context class managing global ZeroMQ state, thread pools, and socket lifecycle; single point of control for the entire library.
  • src/msg.hpp — Message frame abstraction; core data structure for all message passing throughout the library.
  • CMakeLists.txt — Primary build configuration; defines compilation flags, platform detection, and dependency resolution for the entire project.
  • src/poller.hpp — I/O multiplexing abstraction handling socket readiness monitoring across different OS platforms (epoll, kqueue, select).
  • src/stream_engine.hpp — ZMTP/3.1 protocol state machine; implements the wire protocol that all TCP and IPC connections use for message framing and negotiation.

🛠️How to make changes

Add a new socket type (e.g., CUSTOM)

  1. Create socket implementation inheriting from socket_base (e.g., src/custom.hpp and src/custom.cpp) (src/custom.hpp)
  2. Implement required virtual methods: xsend(), xrecv(), xhas_in(), xhas_out(), process_term(), etc. (src/custom.cpp)
  3. Register socket type in socket_base.cpp factory method or in ctx.cpp socket creation logic (src/ctx.cpp)
  4. Add socket type constant to include/zmq.h (e.g., #define ZMQ_CUSTOM 123) (include/zmq.h)
  5. Update CMakeLists.txt to compile new source files (CMakeLists.txt)
  6. Write unit tests in tests/ directory to verify message routing behavior (tests/test_custom.cpp)

Add a new transport (e.g., QUIC support)

  1. Create connecter and listener classes (src/quic_connecter.hpp, src/quic_listener.hpp) (src/quic_connecter.hpp)
  2. Implement stream_engine integration for ZMTP/3.1 framing over QUIC (src/quic_listener.cpp)
  3. Add address parsing in zmq.cpp or endpoint resolver to handle quic:// scheme (src/zmq.cpp)
  4. Register connecter/listener factory in socket_base.cpp bind/connect methods (src/socket_base.cpp)
  5. Update CMakeLists.txt with QUIC transport build toggle and dependency detection (CMakeLists.txt)

Add a new security mechanism (e.g., OAuth2 authentication)

  1. Create mechanism class inheriting from mechanism.hpp (src/oauth2_server.hpp, src/oauth2_client.hpp) (src/oauth2_server.hpp)
  2. Implement handshake() and status() methods for ZMTP/3.1 security negotiation (src/oauth2_server.cpp)
  3. Register mechanism name in stream_engine.cpp mechanism factory method (src/stream_engine.cpp)
  4. Add socket options ZMQ_PLAIN_USERNAME -> ZMQ_OAUTH2_TOKEN in options.hpp (src/options.hpp)

Add a socket option (e.g., ZMQ_MAX_MSG_SIZE)

  1. Define constant in include/zmq.h and add to socket_base.hpp enum (include/zmq.h)
  2. Add storage field and getter/setter in src/options.hpp (src/options.hpp)
  3. Implement setsockopt/getsockopt logic in socket_base.cpp or zmq.cpp (src/socket_base.cpp)
  4. Enforce option in relevant code paths (e.g., msg.cpp if it affects message size) (src/msg.cpp)

🪤Traps & gotchas

Autotools + CMake skew: Changes to features or dependencies must be synchronized in both Makefile.am and CMakeLists.txt; CI may pass one but fail the other. ZMTP protocol strictness: ZMTP/3.1 handshake is critical; breaking it silently fails peer connections. Transport selection at socket creation: Socket type determines transport; changing transport after bind/connect is not supported. Optional dependencies: PGM, NORM, GSSAPI are compile-time; runtime feature detection is unavailable for these. Platform-specific includes: Windows uses WSA socket API (not POSIX); see src/winsock.hpp for Windows-only code. Thread safety: ctx_t is thread-safe but user code must serialize calls to individual socket_base_t instances; this is not enforced.

🏗️Architecture

💡Concepts to learn

  • zeromq/pyzmq — Official Python bindings for libzmq; users of C libzmq often build polyglot systems with Python clients/servers
  • zeromq/zproject — ZeroMQ project automation tool; generates language bindings and CI configs for ZMQ libraries
  • zeromq/czmq — Higher-level C API wrapper around libzmq; provides context management, sockets, and messaging patterns in pure C
  • nanomsg/nanomsg — Alternative lightweight messaging library with similar socket/pattern design; users evaluate both for performance/feature tradeoffs
  • imatix/zfl — ZeroMQ Foundation Library; provides Lua bindings and interoperability layer for libzmq in embedded systems

🪄PR ideas

To work on one of these in Claude Code or Cursor, paste: Implement the "<title>" PR idea from CLAUDE.md, working through the checklist as the task list.

Add GitHub Actions CI workflow for QNX platform builds

The repo has dedicated QNX build infrastructure (build_qnx/ directory with Makefiles for aarch64 and x86_64) but no corresponding GitHub Actions workflow. Currently only CI.yaml, Docs.yaml, and Fuzzers.yaml exist. This would catch QNX-specific regressions early and validate the existing QNX build system.

  • [ ] Create .github/workflows/QNX.yaml following the pattern of CI.yaml
  • [ ] Add build steps for both build_qnx/nto/aarch64 and build_qnx/nto/x86_64 targets
  • [ ] Reference the qnx.nto.toolchain.cmake from builds/cmake/
  • [ ] Test against the QNX container if available, or use cross-compilation setup
  • [ ] Document QNX build requirements in README or CONTRIBUTING.md

Add integration tests for ZMTP/3.1 protocol compliance

The repo implements ZMTP/3.1 (ZeroMQ Message Transport Protocol) as stated in the description, but the file structure shows only general test infrastructure. Adding dedicated ZMTP/3.1 protocol tests would validate message frame formatting, handshake sequences, and protocol version negotiation against the spec.

  • [ ] Create tests/zmtp31_protocol_test.cpp with test cases for frame construction
  • [ ] Add tests for ZMTP greeting/handshake sequence validation
  • [ ] Include tests for message flag handling (MORE, COMMAND, etc.)
  • [ ] Test protocol version negotiation between different ZMQ versions
  • [ ] Reference ZMTP/3.1 specification URLs in test comments for maintainability

Add CMake/Conan cross-compilation documentation and validation

The repo supports multiple platforms (QNX, Android, Cygwin) and has extensive CMake infrastructure, but .readthedocs.yaml and builds/cmake/ suggest incomplete cross-compilation guidance. New contributors struggle with cross-platform builds. Adding a specific cross-compilation guide with worked examples would lower barrier to entry.

  • [ ] Create docs/CROSS_COMPILATION.md with examples for Android, QNX, ARM architectures
  • [ ] Reference the existing toolchain files: builds/cmake/qnx.nto.toolchain.cmake and builds/android/
  • [ ] Include troubleshooting section for common CMake cross-compilation errors
  • [ ] Add a CI workflow check (or update CI.yaml) that validates at least one cross-compilation target succeeds
  • [ ] Link new doc from README.md and .github/CONTRIBUTING.md

🌿Good first issues

  • Add unit test coverage for src/msg.cpp message frame implementation; currently test_msg.cpp is sparse and lacks edge cases for zero-copy semantics and metadata handling.
  • Extend .github/workflows/CI.yaml to include a new Python-based integration test suite (use existing tests/ infrastructure) that validates messaging patterns across process boundaries using PyZMQ.
  • Document the inproc transport implementation (src/inproc*.cpp) in README.doxygen.md with a code example showing why it's faster than TCP for same-host IPC; currently only TCP/Unix sockets are documented.

Top contributors

Click to expand

📝Recent commits

Click to expand
  • b946c18 — build: default to epoll for MinGW on Windows (fix IPC/select issue) (ynkan)
  • 7d95ac0 — Add VSOCK transport support on Linux (remijouannet)
  • 66f512b — AIX doesn't support MSG_DONTWAIT (Lakshmi-Surekha)
  • 3a1af92 — TST: bind bsd socket to loopback instead of all interfaces (minrk)
  • 51a5a9c — Problem: CACHELINE_SIZE conditions check string after numeric comparisons (jiridanek)
  • 00f12d2 — test_mock_pub_sub: increase wait time in mock pub/sub test for loaded systems (Thomas-Barbier-1A)
  • 900a548 — problem: no API to disconnect a specific peer by routing id (somdoron)
  • 7a7bfa1 — CMake: fix installation of config files on MinGW (carlo-bramini)
  • aaf88cd — Update vmci_listener.cpp (mgaertne)
  • 3e5ce5c — The tests/test_radio_dish test implements is_multicast_available() to (ellert)

🔒Security observations

The libzmq repository demonstrates good security practices with a documented security policy, responsible disclosure contacts, and multi-stage Docker builds. However, several areas require attention: the Dockerfile uses an outdated, unsupported Debian base image (buster) that lacks security patches, security hardening compiler flags are not explicitly configured, and there is no container image scanning or SBOM generation in the visible build pipeline. The security policy could be more specific regarding version support timelines. No critical vulnerabilities related to hardcoded secrets, injection risks, or obvious misconfigurations were detected in the provided file structure. Recommend updating the base image, implementing hardening flags, and integrating security scanning into CI/CD workflows.

  • Medium · Outdated Base Image in Dockerfile — Dockerfile (lines 1 and 20). The Dockerfile uses 'debian:buster-slim' which is outdated (Debian 10, released 2019). Buster reached end-of-life and no longer receives security updates. This exposes the build and runtime environments to known vulnerabilities in base OS packages. Fix: Update to a current Debian version such as 'debian:bookworm-slim' or 'debian:bullseye-slim' to receive ongoing security patches.
  • Medium · Missing Security Headers and Build Hardening Flags — Dockerfile (line 24: ./configure command). The Dockerfile build configuration does not specify security hardening compilation flags (e.g., -fPIE, -fstack-protector-strong, RELRO, BIND_NOW). The configure script invocation lacks explicit hardening options. Fix: Add explicit hardening flags to configure: './configure --prefix=/usr/local --with-libsodium --with-libgssapi_krb5 --enable-code-coverage' and ensure CFLAGS/CXXFLAGS include '-fPIE -fstack-protector-strong'. Add '-Wl,-z,relro -Wl,-z,now' to LDFLAGS.
  • Low · Incomplete Security Policy Coverage — SECURITY.md. The SECURITY.md file documents supported versions (4.x) but the policy states versions < 4.0 are unsupported. However, no explicit timeline or deprecation warnings are provided for older 4.x versions (e.g., 4.0.x, 4.1.x). This could lead to confusion about security support duration. Fix: Extend the security policy to include end-of-life dates for each version. Define the support lifecycle clearly (e.g., security fixes provided for N years from release date).
  • Low · Multi-Stage Build Without Security Scanning — Dockerfile and .github/workflows/CI.yaml. While the Dockerfile uses multi-stage builds (good practice), there is no image scanning, vulnerability checks, or signed attestation in the build pipeline. The CI/CD workflows are referenced but not fully visible for security analysis. Fix: Integrate container image scanning tools (e.g., Trivy, Grype) into CI/CD pipelines. Sign container images and implement supply chain security checks per SLSA framework.
  • Low · No SBOM (Software Bill of Materials) Metadata — Repository root (missing SBOM file). The repository does not include SBOM metadata in standard formats (SPDX, CycloneDX). This makes it difficult for downstream consumers to identify included dependencies and their security status. Fix: Generate and maintain an SBOM using tools like 'cyclonedx-maven-plugin' or 'syft'. Include SBOM in release artifacts and CI/CD pipeline.

LLM-derived; treat as a starting point, not a security audit.


Generated by RepoPilot. Verdict based on maintenance signals — see the live page for receipts. Re-run on a new commit to refresh.

Healthy signals · zeromq/libzmq — RepoPilot