Binary protocol surface
Define a fixed frame header, frame types, byte order, payload rules, checksum policy, protocol documentation, and generated layout output.
Build a local TCP gateway that accepts custom binary frames, parses partial socket chunks, rejects malformed clients, applies sink pressure, forwards events, exposes metrics, and writes reports from real load runs.
$ npm run protocolPrints the binary header and validation rules.
$ npm run server -- --port 41234Starts the TCP listener with explicit flags.
$ npm run client -- --port 41234 --name user.loginSends one valid frame through the parser.
$ npm run server -- --sink file --slow-sink-ms 10Makes sink backpressure part of the run.
$ npm run gateway -- metrics --port 9090Checks the runtime counters from the outside.
Define a fixed frame header, frame types, byte order, payload rules, checksum policy, protocol documentation, and generated layout output.
Build client tooling that writes frames, server parsing that reads them, and test paths that prove round trips, partial chunks, and combined buffers.
Forward normalized events to NDJSON files or HTTP targets while tracking queue pressure, drain events, retries, timeouts, drops, and socket pause/resume counts.
Expose live gateway state, persist metrics samples, run multi-client load, track ACK latency when enabled, and generate Markdown plus HTML reports from actual run data.
The build starts with a clean command surface and ends with a generated protocol report. Each phase adds one observable gateway capability and one artifact to inspect.
Create the protocol gateway project shell with runnable server and client modes.
Define the binary frame layout, publish it in docs/protocol.md, and print the layout from code.
Build a client-side encoder that turns an event object into one valid binary frame.
Parse one complete binary frame from a Buffer and return the normalized event.
Accept TCP socket connections and log connection lifecycle events.
Send one encoded frame from a TCP client to the server.
Parse frames split across multiple TCP chunks.
Parse several frames from one received Buffer.
Reject bad magic bytes, unsupported versions, invalid lengths, unknown frame types, and checksum failures.
Track connection state, idle timeouts, and close reasons.
Write normalized events to disk while respecting writable stream backpressure.
Forward normalized events to a local HTTP endpoint with concurrency limits, timeouts, retries, and failure counts.
Expose runtime metrics while the gateway is running.
Stop accepting new connections, drain existing work, close sockets according to policy, and write a final report.
Stress the gateway with many connections, frame counts, frame rates, payload sizes, and malformed ratios.
Produce a Markdown and HTML report that summarizes protocol design, parser behavior, error policy, backpressure behavior, shutdown behavior, and load results.
Lab 07 turns protocol rules, connection state, malformed input, sink pressure, HTTP delivery, metrics, shutdown, and load results into files a developer can inspect after the run.
docs/protocol.mdwire format, frame types, and validation rulesdata/events.ndjsonnormalized file-sink event recordsdata/http-received.ndjsonevents accepted by the local receiverconnections.jsonlconnection lifecycle and close reasonsprotocol-errors.jsonlmalformed frame evidence by error codemetrics.jsonlgateway samples captured during runtimeload-latest.jsonthroughput, latency, errors, and pressureprotocol-gateway.htmlfinal human-readable gateway reportSwitch between one-reader pricing and team licenses for up to 25 team members.
Volume I as EPUB, light/dark PDFs, slides, cheatsheets, and future updates.
All Labs plus the downloadable Volume I bundle in one purchase. Save $9.99 vs buying separately.
Seven long-form builds: recorder, binary store, stream workbench, resolver, watcher, task runtime, and protocol gateway.
Volume I files, slides, cheatsheets, and updates for a small engineering team.
Node Runtime Labs plus the downloadable Volume I bundle in one team license.
Seven long-form builds for onboarding, study groups, and internal training.
The bundle includes seven runtime projects covering process observation, binary storage, streams, module resolution, file watching, async orchestration, and custom protocols.