Celerity
Celerity is a pure Rust implementation of ZMTP 3.1 built around a sans-IO core. The protocol engine stays as a state machine, while the Tokio layer handles TCP and Unix domain socket transport for practical use.
The project is aimed at people who want a small, direct Rust messaging stack without pulling in a C library or hiding the wire protocol behind too much magic.
What It Includes
- ZMTP 3.1 greeting, handshake, framing, and multipart message handling
- Sans-IO
CelerityPeercore - Tokio transport wrappers for TCP and IPC on Unix
PUB/SUBandREQ/REPhelpers- CURVE-RS encrypted transport mode for non-local links
cel-catCLI for quick local testing
Install
Build the library
Install the CLI from source
Run the full test suite
Feature Flags
tokio: enables the Tokio transport layercli: builds thecel-catutilityipc: enables Unix domain socket supportcurve: enables CURVE-RS security
For day-to-day local testing, --all-features is the simplest path.
CLI Quick Start
Local TCP on one machine
Terminal 1:
Terminal 2:
TCP between your host and a VM on the same network
This is still TCP. It is the right transport when your host machine and a VM need to talk over a real IP address on the same LAN, bridged adapter, or host-only network.
Example with the host publishing and the VM subscribing:
On your host Mac:
On your Kali VM:
Example with the VM publishing and the host subscribing:
On your Kali VM:
On your host Mac:
IPC on the same machine
ipc:// uses Unix domain sockets, so both processes must run on the same machine.
Terminal 1:
Terminal 2:
Multi-word messages
cel-cat pub accepts trailing words as one message, so this works as expected:
Local, IPC, and Remote Use
Loopback TCP
127.0.0.1 and localhost are treated as local links. That means NULL security is allowed by default for quick development and local testing.
IPC
IPC is local-only. It does not travel over Wi-Fi, Ethernet, or between separate VMs. It is the fastest and simplest option when both processes live on the same host.
Remote TCP
For non-loopback TCP, the intended path is CURVE-RS. The library defaults to failing closed for remote NULL unless you explicitly opt into insecure mode.
The high-level CLI is meant for local workflows first. For remote hosts, use the library API with an explicit SecurityConfig::curve() setup and managed key material.
That means host-to-VM traffic over a real IP is TCP, but it is no longer treated as a local loopback link. If you want that path to be secure and reliable beyond local experiments, use CURVE-RS through the library API rather than relying on plain NULL.
Using It As a Library
Add the crate with the feature set you need:
[]
= { = "0.1.0", = ["tokio", "ipc", "curve"] }
At the core is CelerityPeer, which owns protocol state but no sockets. The Tokio wrappers in celerity::io sit on top when you want real network transport.
Project Layout
src/lib.rs: public API and shared protocol typessrc/peer.rs: sans-IO ZMTP peer state machinesrc/pattern.rs:PUB/SUBandREQ/REPcoordinatorssrc/io/: Tokio transport, endpoint parsing, and socket wrapperssrc/security/: NULL and CURVE-RS mechanismssrc/bin/cel_cat.rs: small CLI for interactive testing
Development
Format and test before pushing:
Release Notes
For the initial release:
License
Licensed under either:
- MIT
- Apache-2.0