14.0.0 · Rust 1.85+

Dependency-free native IPC for Rust.

The Rust crate implements the node-ipc event envelope and delimiter framing with blocking native transports and no runtime or build dependencies.

0 runtime dependencies0 build dependenciesNative targets only

Install the exact crate

[dependencies]
node-ipc = "=14.0.0"

Version 14 is the first paired Node.js and Rust release. The crate requires Rust 1.85 or newer. Its only development dependency is exact vanilla-test 2.1.0; production remains dependency-free.

Blocking TCP client

use node_ipc::{tcp, CodecConfig, Connection, Event, Message};

fn main() -> node_ipc::Result<()> {
    let stream = tcp::connect(("127.0.0.1", 9763))?;
    let mut connection = Connection::new(stream, CodecConfig::fast())?;

    connection.send(&Event::new("example.request", "hello"))?;
    if let Some(Message::Event(response)) = connection.recv()? {
        println!("{}", response.data.to_json_string());
    }
    Ok(())
}

Connection<S> works over a TCP stream, Unix stream, Windows named pipe, or caller-supplied TLS stream when S implements Read + Write.

Native transport boundaries

TransportRust implementationBoundary
TCPBlocking standard-library client and listenerReliable ordered bytes; no identity or confidentiality
UDP4 / UDP6Native datagrams with peer-isolated fragment stateApplication owns loss, ordering, authentication, and rate limits
Unix localUnix-domain streams with conservative endpoint cleanupApplication owns secure parent-directory and peer policy
Windows localByte-mode named pipes through narrow Win32 bindingsApplication must create and verify any required ACL
TLSGeneric Read + Write integration boundaryApplication selects TLS, verifies identity, and authorizes the peer

Profiles select protocol work

Raw

Pass bytes directly. The application owns framing and every validation rule.

Fast

Encode and decode the canonical JSON event envelope with delimiter framing.

Guarded

Add frame, event-name, reserved-name, per-frame write, and incomplete-frame limits.

Assured

Add an event allow-list. Transport authentication is still caller-owned.

Rust writes synchronously.

max_pending_bytes is a per-frame write ceiling, not a measurement of Node.js-style queued socket writes.

Assured does not authenticate an arbitrary stream.

The Rust codec cannot prove the identity or authorization of a caller-supplied transport. Network use requires application-supplied verified mTLS; local use requires application-verified endpoint ownership and access control.

Release scope

Native only

This release has no browser adapter, WASM ABI, WASM build, or browser test path. Rust/WASM would not unlock raw browser sockets by itself.

Wire-compatible, not value-identical

Normal framed messages interoperate with Node.js. Review number precision, duplicate members, Unicode, malformed JSON, delimiter, and incomplete-frame boundaries before sharing language-specific values.

Read the exact contract →