ModeSizeName
-r-xr-xr-x  crates
-r-xr-xr-x  docs
-r-xr-xr-x  scripts
-rw-r--r--8.gitignore
-rw-r--r--3281.sai.json
-rw-r--r--7140AGENTS.md
-rw-r--r--248Cargo.lock
-rw-r--r--1056Cargo.toml
-rw-r--r--2127README.md
-rw-r--r--207clippy.toml
-rw-r--r--391deny.toml
README.md

npro

npro is the Rust port of the sansIO half of libwebsockets: h1, h2, h3, ws and wt as safe, no_std state machines that take bytes and time in and give bytes and events out, with an IO crate for sockets, tls and the event loop beside them.

Home: <https://npro.rs> ยท Source: <https://libwebsockets.org/git/npro>

Status: nothing usable yet. The workspace and its gates are in place, and the protocol crates arrive phase by phase as described in docs/port-plan.md.

How it is written, and how it is checked

npro is written by AI coding agents working with Andy Green, the author of libwebsockets, who reviews and directs the work. It is a port of behaviour, not a transliteration of C: the C library's sansIO half is the specification, and the port is held to it by:

  • transcripts: byte-for-byte records of connections driven through C lws with no socket and no clock of its own (minimal-examples-lowlevel/api-tests/api-test-sansio in the C tree), which npro replays;
  • the C state tables: every state transition C allows, from lib/sansio/wsi-state.c, which npro's state enums must match;
  • fuzzing, seeded from the C library's fuzz corpora;
  • differential and conformance testing, against C lws and the autobahn, h2spec and h3spec suites, as the IO crate makes them possible.

And by the rules in AGENTS.md: - every crate is #![forbid(unsafe_code)]; - nothing reachable from network data may panic; - arithmetic on lengths is checked; - the dependency tree stays close to empty.

scripts/ci.sh runs the gates every commit passes: fmt, clippy (with the panic, indexing, arithmetic and cast lints denied), tests, docs, a build at the minimum supported Rust version, cargo deny and cargo audit. sai runs them, and more, across the C library's builders: the tests natively on Linux, macOS, riscv64 and Windows, every feature combination, no_std targets, big-endian and 32-bit machines under Miri, and a check that C lws still records the transcripts npro holds (docs/sai.md).

Licence

MIT