Files
skills/docs/networking/drive/drive-transport-https/README.md
2026-05-29 08:20:56 +01:00

4.3 KiB

@suaveplan/drive-transport-https - HTTPS relay transport for the drive mesh. Implements TransportLike over a relay endpoint with bearer auth, long-poll receive, exponential backoff, and AbortSignal cancellation.

Summary

HTTPS-relay-backed TransportLike<MessageEnvelope> for the Suaveplan drive mesh. Implements long-poll receive, stateless POST send, exponential backoff with equal-jitter, and Zod-validated wire format. Browser-friendly: the relay is the only HTTP server in the loop, so peers never need to host an inbound endpoint.

import { HttpsTransport } from "@suaveplan/drive-transport-https";

const transport = new HttpsTransport({
    relayUrl: "https://relay.example.com",
    ourPeerId: "ab12...",
    authToken: process.env.RELAY_TOKEN,
});
transport.start();
const off = transport.onMessage((envelope) => console.log(envelope.id));
await transport.connect("peer-b", "ignored");
await transport.send("peer-b", envelope);
off();
await transport.stop();

See src/transport/https-transport.md for full semantics, error-handling guidance, and the relay contract.

Documentation tree

  • schemas — (no submodules)
  • defaults — Centralises default values for HttpsTransport so every part of the package agrees on the same numbers. Living in its…
  • https-transport — Implements HttpsTransport, the HTTPS-relay-backed TransportLike<MessageEnvelope> for @suaveplan/drive-mesh and an…
  • error-codes — Defines the structured error registry for @suaveplan/drive-transport-https. Every failure mode the HTTPS relay transp…
- [transport.schema](./src/schemas/transport.schema.md) — _(no submodules)_- [defaults](./src/transport/defaults.md) — Centralises default values for `HttpsTransport` so every part of the package agrees on the same numbers. Living in its…
  • https-transport — Implements HttpsTransport, the HTTPS-relay-backed TransportLike<MessageEnvelope> for @suaveplan/drive-mesh and an…
  • error-codes — Defines the structured error registry for @suaveplan/drive-transport-https. Every failure mode the HTTPS relay transp…
  • transport.schema — (no submodules)- defaults — Centralises default values for HttpsTransport so every part of the package agrees on the same numbers. Living in its…
  • https-transport — Implements HttpsTransport, the HTTPS-relay-backed TransportLike<MessageEnvelope> for @suaveplan/drive-mesh and an…
  • error-codes — Defines the structured error registry for @suaveplan/drive-transport-https. Every failure mode the HTTPS relay transp…
  • transport.schema — (no submodules)- defaults — Centralises default values for HttpsTransport so every part of the package agrees on the same numbers. Living in its…
  • https-transport — Implements HttpsTransport, the HTTPS-relay-backed TransportLike<MessageEnvelope> for @suaveplan/drive-mesh and an…
  • error-codes — Defines the structured error registry for @suaveplan/drive-transport-https. Every failure mode the HTTPS relay transp…
  • transport.schema — (no submodules)- defaults — Centralises default values for HttpsTransport so every part of the package agrees on the same numbers. Living in its…
  • https-transport — Implements HttpsTransport, the HTTPS-relay-backed TransportLike<MessageEnvelope> for @suaveplan/drive-mesh and an…
  • error-codes — Defines the structured error registry for @suaveplan/drive-transport-https. Every failure mode the HTTPS relay transp…