@serve-tools/client-shared-webtransport
v0.1.2
Published
SharedWorker-owned typed WebTransport operations and datagrams
Maintainers
Readme
@serve-tools/client-shared-webtransport
@serve-tools/client-shared-webtransport shares one typed WebTransport session across pages through a SharedWorker.
Call listen() in the worker and connect(worker.port) in each page.
Reliable requests and subscriptions retain the direct client's semantics.
Typed datagram write(), subscribe(), and read() operations are routed through the worker-owned session.
Install
npm install @serve-tools/client-shared-webtransportThe worker owns the physical session, reliable streams, datagram registry, and native datagram writer.
Each page owns its logical client, subscriptions, and port.
maxDatagramSize is a Promise because the native value is worker-owned.
Pending read() calls reject and remove their page-local subscriptions when either the page client or worker-owned session closes.
The shared client intentionally does not expose createWritable() because native WebTransport scheduling groups and writable ownership cannot retain their semantics across a MessagePort.
Datagrams remain best-effort and unbuffered. The package does not add reconnection, replay, persistence, resumption, or Media over QUIC sharing.
Agent Skill
The package includes an Agent Skill at skills/serve-tools-client-shared-webtransport.
