@webtransport-bun/webtransport 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/errors.d.ts +54 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +53 -0
- package/dist/index.d.ts +489 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1356 -0
- package/dist/streams.d.ts +72 -0
- package/dist/streams.d.ts.map +1 -0
- package/dist/streams.js +177 -0
- package/package.json +1 -1
- package/prebuilds/SHA256SUMS +1 -1
- package/prebuilds/webtransport-native.linux-x64-gnu.node +0 -0
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable error codes for WebTransport operations (AGENTS.md / docs/SPEC.md).
|
|
3
|
+
* Use with WebTransportError.code for programmatic handling.
|
|
4
|
+
*/
|
|
5
|
+
/** W3C WebTransportErrorSource: stream or session. */
|
|
6
|
+
export type WebTransportErrorSource = "stream" | "session";
|
|
7
|
+
/** TLS/certificate failure. */
|
|
8
|
+
export declare const E_TLS = "E_TLS";
|
|
9
|
+
/** Connection handshake timed out (limits.handshakeTimeoutMs). */
|
|
10
|
+
export declare const E_HANDSHAKE_TIMEOUT = "E_HANDSHAKE_TIMEOUT";
|
|
11
|
+
/** Session already closed or in invalid state. */
|
|
12
|
+
export declare const E_SESSION_CLOSED = "E_SESSION_CLOSED";
|
|
13
|
+
/** Session idle timeout exceeded. */
|
|
14
|
+
export declare const E_SESSION_IDLE_TIMEOUT = "E_SESSION_IDLE_TIMEOUT";
|
|
15
|
+
/** Stream was reset by peer. */
|
|
16
|
+
export declare const E_STREAM_RESET = "E_STREAM_RESET";
|
|
17
|
+
/** Peer sent stopSending. */
|
|
18
|
+
export declare const E_STOP_SENDING = "E_STOP_SENDING";
|
|
19
|
+
/** Queue/buffer full (backpressure). */
|
|
20
|
+
export declare const E_QUEUE_FULL = "E_QUEUE_FULL";
|
|
21
|
+
/** Backpressure wait exceeded timeout. */
|
|
22
|
+
export declare const E_BACKPRESSURE_TIMEOUT = "E_BACKPRESSURE_TIMEOUT";
|
|
23
|
+
/** Resource limit exceeded. */
|
|
24
|
+
export declare const E_LIMIT_EXCEEDED = "E_LIMIT_EXCEEDED";
|
|
25
|
+
/** Rate limit (token bucket) exceeded. */
|
|
26
|
+
export declare const E_RATE_LIMITED = "E_RATE_LIMITED";
|
|
27
|
+
/** Internal/unsupported option or unexpected error. */
|
|
28
|
+
export declare const E_INTERNAL = "E_INTERNAL";
|
|
29
|
+
export type ErrorCode = typeof E_TLS | typeof E_HANDSHAKE_TIMEOUT | typeof E_SESSION_CLOSED | typeof E_SESSION_IDLE_TIMEOUT | typeof E_STREAM_RESET | typeof E_STOP_SENDING | typeof E_QUEUE_FULL | typeof E_BACKPRESSURE_TIMEOUT | typeof E_LIMIT_EXCEEDED | typeof E_RATE_LIMITED | typeof E_INTERNAL;
|
|
30
|
+
/** Options for WebTransportError (W3C-aligned). */
|
|
31
|
+
export type WebTransportErrorOptions = {
|
|
32
|
+
source?: WebTransportErrorSource;
|
|
33
|
+
streamErrorCode?: number | null;
|
|
34
|
+
cause?: unknown;
|
|
35
|
+
/**
|
|
36
|
+
* Browser-style DOMException name when known (e.g. NotSupportedError, TypeError).
|
|
37
|
+
* When set, Error.name is set to this for browser/isomorphic compatibility.
|
|
38
|
+
* E_* code is always preserved for programmatic handling.
|
|
39
|
+
*/
|
|
40
|
+
browserName?: string;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Custom error class for WebTransport errors.
|
|
44
|
+
* Carries a stable error code for programmatic handling.
|
|
45
|
+
* W3C-aligned: source ("stream"|"session"), streamErrorCode.
|
|
46
|
+
* When options.browserName is set, name is set for browser-compatible semantics.
|
|
47
|
+
*/
|
|
48
|
+
export declare class WebTransportError extends Error {
|
|
49
|
+
readonly code: ErrorCode;
|
|
50
|
+
readonly source: WebTransportErrorSource;
|
|
51
|
+
readonly streamErrorCode: number | null;
|
|
52
|
+
constructor(code: ErrorCode, message?: string, options?: WebTransportErrorOptions);
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,sDAAsD;AACtD,MAAM,MAAM,uBAAuB,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE3D,+BAA+B;AAC/B,eAAO,MAAM,KAAK,UAAU,CAAC;AAC7B,kEAAkE;AAClE,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AACzD,kDAAkD;AAClD,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AACnD,qCAAqC;AACrC,eAAO,MAAM,sBAAsB,2BAA2B,CAAC;AAC/D,gCAAgC;AAChC,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAC/C,6BAA6B;AAC7B,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAC/C,wCAAwC;AACxC,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAC3C,0CAA0C;AAC1C,eAAO,MAAM,sBAAsB,2BAA2B,CAAC;AAC/D,+BAA+B;AAC/B,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AACnD,0CAA0C;AAC1C,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAC/C,uDAAuD;AACvD,eAAO,MAAM,UAAU,eAAe,CAAC;AAEvC,MAAM,MAAM,SAAS,GAClB,OAAO,KAAK,GACZ,OAAO,mBAAmB,GAC1B,OAAO,gBAAgB,GACvB,OAAO,sBAAsB,GAC7B,OAAO,cAAc,GACrB,OAAO,cAAc,GACrB,OAAO,YAAY,GACnB,OAAO,sBAAsB,GAC7B,OAAO,gBAAgB,GACvB,OAAO,cAAc,GACrB,OAAO,UAAU,CAAC;AAErB,mDAAmD;AACnD,MAAM,MAAM,wBAAwB,GAAG;IACtC,MAAM,CAAC,EAAE,uBAAuB,CAAC;IACjC,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;;;GAKG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;IAC3C,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,uBAAuB,CAAC;IACzC,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;gBAGvC,IAAI,EAAE,SAAS,EACf,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,wBAAwB;CAQnC"}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable error codes for WebTransport operations (AGENTS.md / docs/SPEC.md).
|
|
3
|
+
* Use with WebTransportError.code for programmatic handling.
|
|
4
|
+
*/
|
|
5
|
+
/** TLS/certificate failure. */
|
|
6
|
+
export const E_TLS = "E_TLS";
|
|
7
|
+
/** Connection handshake timed out (limits.handshakeTimeoutMs). */
|
|
8
|
+
export const E_HANDSHAKE_TIMEOUT = "E_HANDSHAKE_TIMEOUT";
|
|
9
|
+
/** Session already closed or in invalid state. */
|
|
10
|
+
export const E_SESSION_CLOSED = "E_SESSION_CLOSED";
|
|
11
|
+
/** Session idle timeout exceeded. */
|
|
12
|
+
export const E_SESSION_IDLE_TIMEOUT = "E_SESSION_IDLE_TIMEOUT";
|
|
13
|
+
/** Stream was reset by peer. */
|
|
14
|
+
export const E_STREAM_RESET = "E_STREAM_RESET";
|
|
15
|
+
/** Peer sent stopSending. */
|
|
16
|
+
export const E_STOP_SENDING = "E_STOP_SENDING";
|
|
17
|
+
/** Queue/buffer full (backpressure). */
|
|
18
|
+
export const E_QUEUE_FULL = "E_QUEUE_FULL";
|
|
19
|
+
/** Backpressure wait exceeded timeout. */
|
|
20
|
+
export const E_BACKPRESSURE_TIMEOUT = "E_BACKPRESSURE_TIMEOUT";
|
|
21
|
+
/** Resource limit exceeded. */
|
|
22
|
+
export const E_LIMIT_EXCEEDED = "E_LIMIT_EXCEEDED";
|
|
23
|
+
/** Rate limit (token bucket) exceeded. */
|
|
24
|
+
export const E_RATE_LIMITED = "E_RATE_LIMITED";
|
|
25
|
+
/** Internal/unsupported option or unexpected error. */
|
|
26
|
+
export const E_INTERNAL = "E_INTERNAL";
|
|
27
|
+
/**
|
|
28
|
+
* Custom error class for WebTransport errors.
|
|
29
|
+
* Carries a stable error code for programmatic handling.
|
|
30
|
+
* W3C-aligned: source ("stream"|"session"), streamErrorCode.
|
|
31
|
+
* When options.browserName is set, name is set for browser-compatible semantics.
|
|
32
|
+
*/
|
|
33
|
+
export class WebTransportError extends Error {
|
|
34
|
+
code;
|
|
35
|
+
source;
|
|
36
|
+
streamErrorCode;
|
|
37
|
+
constructor(code, message, options) {
|
|
38
|
+
super(message ?? code, { cause: options?.cause ?? { code } });
|
|
39
|
+
this.name = options?.browserName ?? "WebTransportError";
|
|
40
|
+
this.code = code;
|
|
41
|
+
this.source = options?.source ?? codeToSource(code);
|
|
42
|
+
this.streamErrorCode = options?.streamErrorCode ?? null;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function codeToSource(code) {
|
|
46
|
+
switch (code) {
|
|
47
|
+
case E_STREAM_RESET:
|
|
48
|
+
case E_STOP_SENDING:
|
|
49
|
+
return "stream";
|
|
50
|
+
default:
|
|
51
|
+
return "session";
|
|
52
|
+
}
|
|
53
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,489 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* @module @webtransport-bun/webtransport
|
|
4
|
+
*
|
|
5
|
+
* Production-ready WebTransport for Bun, backed by napi-rs + wtransport (Rust).
|
|
6
|
+
* Supports in-process server, client (Node API and W3C-style facade), datagrams, and streams.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* @example Node client (connect)
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { connect, createServer } from "@webtransport-bun/webtransport";
|
|
12
|
+
* const session = await connect("https://127.0.0.1:4433", {
|
|
13
|
+
* tls: { insecureSkipVerify: true },
|
|
14
|
+
* limits: { handshakeTimeoutMs: 10_000 },
|
|
15
|
+
* });
|
|
16
|
+
* await session.sendDatagram(new Uint8Array([1, 2, 3]));
|
|
17
|
+
* const stream = await session.createBidirectionalStream();
|
|
18
|
+
* stream.write(Buffer.from("hello"));
|
|
19
|
+
* stream.end();
|
|
20
|
+
* session.close();
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @example W3C-style client (new WebTransport)
|
|
24
|
+
* ```ts
|
|
25
|
+
* import { WebTransport, createServer } from "@webtransport-bun/webtransport";
|
|
26
|
+
* const wt = new WebTransport("https://127.0.0.1:4433", {
|
|
27
|
+
* tls: { insecureSkipVerify: true },
|
|
28
|
+
* });
|
|
29
|
+
* await wt.ready;
|
|
30
|
+
* const writer = wt.datagrams.writable.getWriter();
|
|
31
|
+
* await writer.write(new Uint8Array([1, 2, 3]));
|
|
32
|
+
* writer.releaseLock();
|
|
33
|
+
* const { readable, writable } = await wt.createBidirectionalStream();
|
|
34
|
+
* // ... use Web Streams ...
|
|
35
|
+
* wt.close({ closeCode: 1000, reason: "done" });
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @see docs/SPEC.md Authoritative API contract
|
|
39
|
+
* @see docs/PARITY_MATRIX.md W3C spec alignment
|
|
40
|
+
*/
|
|
41
|
+
import type { Duplex, Readable, Writable } from "node:stream";
|
|
42
|
+
export { WT_RESET, WT_STOP_SENDING } from "./streams.js";
|
|
43
|
+
export type { Resettable, StopSendable } from "./streams.js";
|
|
44
|
+
import { type Resettable, type StopSendable } from "./streams.js";
|
|
45
|
+
/**
|
|
46
|
+
* Stable error codes. Use with {@link WebTransportError.code} for programmatic handling.
|
|
47
|
+
* @see WebTransportError
|
|
48
|
+
*/
|
|
49
|
+
export { E_TLS, E_HANDSHAKE_TIMEOUT, E_SESSION_CLOSED, E_SESSION_IDLE_TIMEOUT, E_STREAM_RESET, E_STOP_SENDING, E_QUEUE_FULL, E_BACKPRESSURE_TIMEOUT, E_LIMIT_EXCEEDED, E_RATE_LIMITED, E_INTERNAL, WebTransportError, } from "./errors.js";
|
|
50
|
+
export type { ErrorCode, WebTransportErrorOptions, WebTransportErrorSource, } from "./errors.js";
|
|
51
|
+
/** Web IDL BufferSource (ArrayBuffer | ArrayBufferView) for spec alignment */
|
|
52
|
+
type BufferSource = ArrayBuffer | ArrayBufferView;
|
|
53
|
+
/** TLS configuration for server (cert/key) or client (CA, SNI). */
|
|
54
|
+
export type TlsOptions = {
|
|
55
|
+
/** PEM-encoded certificate (server) or CA (client). */
|
|
56
|
+
certPem: string | Uint8Array;
|
|
57
|
+
/** PEM-encoded private key (server only). */
|
|
58
|
+
keyPem: string | Uint8Array;
|
|
59
|
+
/** Optional CA PEM for client verification. */
|
|
60
|
+
caPem?: string | Uint8Array;
|
|
61
|
+
/** SNI for client mode; for server, used in logs/metrics. */
|
|
62
|
+
serverName?: string;
|
|
63
|
+
};
|
|
64
|
+
export type RateLimitOptions = {
|
|
65
|
+
handshakesPerSec: number;
|
|
66
|
+
handshakesBurst: number;
|
|
67
|
+
/** Per /24 (IPv4) or /64 (IPv6) prefix; defaults 100 */
|
|
68
|
+
handshakesBurstPerPrefix?: number;
|
|
69
|
+
streamsPerSec: number;
|
|
70
|
+
streamsBurst: number;
|
|
71
|
+
datagramsPerSec: number;
|
|
72
|
+
datagramsBurst: number;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Resource limits. Merge with {@link DEFAULT_LIMITS} for defaults.
|
|
76
|
+
* @see DEFAULT_LIMITS Default values (e.g. handshakeTimeoutMs: 10000, maxDatagramSize: 1200).
|
|
77
|
+
*/
|
|
78
|
+
export type LimitsOptions = {
|
|
79
|
+
/** Max concurrent sessions. At limit, next handshake is rejected. */
|
|
80
|
+
maxSessions: number;
|
|
81
|
+
/** Max handshakes in progress. At limit, next is rejected (inclusive: limit is allowed). */
|
|
82
|
+
maxHandshakesInFlight: number;
|
|
83
|
+
/** Max bidi streams per session. At limit, createBidirectionalStream rejects with E_LIMIT_EXCEEDED. */
|
|
84
|
+
maxStreamsPerSessionBidi: number;
|
|
85
|
+
/** Max uni streams per session. At limit, createUnidirectionalStream rejects with E_LIMIT_EXCEEDED. */
|
|
86
|
+
maxStreamsPerSessionUni: number;
|
|
87
|
+
/** Max streams across all sessions. At limit, new streams (accept or create) are rejected. */
|
|
88
|
+
maxStreamsGlobal: number;
|
|
89
|
+
/** Hard cap in bytes (also must respect negotiated max). Default 1200. */
|
|
90
|
+
maxDatagramSize: number;
|
|
91
|
+
maxQueuedBytesGlobal: number;
|
|
92
|
+
maxQueuedBytesPerSession: number;
|
|
93
|
+
maxQueuedBytesPerStream: number;
|
|
94
|
+
backpressureTimeoutMs: number;
|
|
95
|
+
/** Connect handshake timeout. Default 10000. */
|
|
96
|
+
handshakeTimeoutMs: number;
|
|
97
|
+
idleTimeoutMs: number;
|
|
98
|
+
};
|
|
99
|
+
/** Default limit values from AGENTS.md */
|
|
100
|
+
export declare const DEFAULT_LIMITS: LimitsOptions;
|
|
101
|
+
/** Default rate-limit values from AGENTS.md */
|
|
102
|
+
export declare const DEFAULT_RATE_LIMITS: RateLimitOptions;
|
|
103
|
+
/** Structured log event. Include sessionId, peerIp, peerPort, error code for incident diagnosis. */
|
|
104
|
+
export type LogEvent = {
|
|
105
|
+
level: "debug" | "info" | "warn" | "error";
|
|
106
|
+
msg: string;
|
|
107
|
+
sessionId?: string;
|
|
108
|
+
peerIp?: string;
|
|
109
|
+
peerPort?: number;
|
|
110
|
+
/** Error code (e.g. E_SESSION_CLOSED), counters context */
|
|
111
|
+
data?: Record<string, unknown>;
|
|
112
|
+
};
|
|
113
|
+
/** Options for {@link createServer}. Limits/rateLimits merge with defaults. */
|
|
114
|
+
export type ServerOptions = {
|
|
115
|
+
host?: string /** @default "0.0.0.0" */;
|
|
116
|
+
port: number;
|
|
117
|
+
tls: TlsOptions;
|
|
118
|
+
limits?: Partial<LimitsOptions>;
|
|
119
|
+
rateLimits?: Partial<RateLimitOptions>;
|
|
120
|
+
/** Called on each accepted session (must not block; long work should be async) */
|
|
121
|
+
onSession: (session: ServerSession) => void | Promise<void>;
|
|
122
|
+
/** Optional logging hook */
|
|
123
|
+
log?: (event: LogEvent) => void;
|
|
124
|
+
/** Debug mode: enables detailed native diagnostics/log payloads (redaction off). */
|
|
125
|
+
debug?: boolean;
|
|
126
|
+
};
|
|
127
|
+
/** Returned by {@link createServer}. Use address, close(), and metricsSnapshot(). */
|
|
128
|
+
export interface WebTransportServer {
|
|
129
|
+
readonly address: {
|
|
130
|
+
host: string;
|
|
131
|
+
port: number;
|
|
132
|
+
};
|
|
133
|
+
close(): Promise<void>;
|
|
134
|
+
metricsSnapshot(): MetricsSnapshot;
|
|
135
|
+
}
|
|
136
|
+
/** Browser-style close info (W3C alignment). Used by {@link WebTransport.close} and {@link WebTransport.closed}. */
|
|
137
|
+
export type WebTransportCloseInfo = {
|
|
138
|
+
closeCode?: number;
|
|
139
|
+
reason?: string;
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* Options for `new WebTransport(url, options)`.
|
|
143
|
+
* `allowPooling` and `requireUnreliable` are accepted with deterministic facade semantics:
|
|
144
|
+
* - `allowPooling`: when true, reuses pooled endpoints for compatible connects; when false, dedicated sessions.
|
|
145
|
+
* - `requireUnreliable`: accepted; current runtime uses QUIC/WebTransport and always supports unreliable delivery.
|
|
146
|
+
*/
|
|
147
|
+
export type WebTransportClientOptions = {
|
|
148
|
+
/** When true, errors use browser-style DOMException names (NotSupportedError, etc.). Default false for backward compat. */
|
|
149
|
+
strictW3CErrors?: boolean;
|
|
150
|
+
serverCertificateHashes?: Array<{
|
|
151
|
+
algorithm: "sha-256";
|
|
152
|
+
value: BufferSource;
|
|
153
|
+
}>;
|
|
154
|
+
allowPooling?: boolean;
|
|
155
|
+
requireUnreliable?: boolean;
|
|
156
|
+
/** Preference hint for congestion control. */
|
|
157
|
+
congestionControl?: "default" | "throughput" | "low-latency";
|
|
158
|
+
/** When "bytes", datagrams.readable is a ReadableByteStream with BYOB support; default uses normal ReadableStream. */
|
|
159
|
+
datagramsReadableType?: "bytes" | "default";
|
|
160
|
+
/** Bun backend extension */
|
|
161
|
+
tls?: {
|
|
162
|
+
insecureSkipVerify?: boolean;
|
|
163
|
+
caPem?: string | Uint8Array;
|
|
164
|
+
serverName?: string;
|
|
165
|
+
};
|
|
166
|
+
limits?: Partial<LimitsOptions>;
|
|
167
|
+
};
|
|
168
|
+
/** Options for {@link connect} (Node client API). */
|
|
169
|
+
export type ClientOptions = {
|
|
170
|
+
tls?: {
|
|
171
|
+
caPem?: string | Uint8Array;
|
|
172
|
+
serverName?: string;
|
|
173
|
+
/** Dev only: skips server cert verification. Requires explicit `true`. Emits warning. Never use in production. */
|
|
174
|
+
insecureSkipVerify?: boolean;
|
|
175
|
+
};
|
|
176
|
+
limits?: Partial<LimitsOptions>;
|
|
177
|
+
log?: (event: LogEvent) => void;
|
|
178
|
+
/** Internal/advanced: cert pinning list serialized as base64. */
|
|
179
|
+
serverCertificateHashes?: Array<{
|
|
180
|
+
algorithm: "sha-256";
|
|
181
|
+
valueBase64: string;
|
|
182
|
+
}>;
|
|
183
|
+
/** Internal/advanced: congestion hint passed to native runtime. */
|
|
184
|
+
congestionControl?: "default" | "throughput" | "low-latency";
|
|
185
|
+
/** Enable connection pooling for compatible connects. */
|
|
186
|
+
allowPooling?: boolean;
|
|
187
|
+
/** Require unreliable (datagram) delivery; participates in pool compatibility. */
|
|
188
|
+
requireUnreliable?: boolean;
|
|
189
|
+
/** When true, errors use browser-style DOMException names. Default false. */
|
|
190
|
+
strictW3CErrors?: boolean;
|
|
191
|
+
};
|
|
192
|
+
export type CloseInfo = {
|
|
193
|
+
code?: number;
|
|
194
|
+
reason?: string;
|
|
195
|
+
};
|
|
196
|
+
export type WebTransportBidirectionalStream = {
|
|
197
|
+
readable: ReadableStream<Uint8Array>;
|
|
198
|
+
writable: WritableStream<Uint8Array>;
|
|
199
|
+
} & Partial<Resettable & StopSendable>;
|
|
200
|
+
/** W3C WebTransportDatagramDuplexStream: readable, writable (compat), createWritable(), maxDatagramSize. */
|
|
201
|
+
export type WebTransportDatagramDuplexStream = {
|
|
202
|
+
readonly readable: ReadableStream<Uint8Array>;
|
|
203
|
+
/** Backward compat: default writable. Prefer createWritable() for multiple writers. */
|
|
204
|
+
readonly writable: WritableStream<Uint8Array>;
|
|
205
|
+
createWritable(options?: {
|
|
206
|
+
sendGroup?: WebTransportSendGroup | null;
|
|
207
|
+
sendOrder?: number;
|
|
208
|
+
}): WritableStream<Uint8Array>;
|
|
209
|
+
readonly maxDatagramSize: number;
|
|
210
|
+
};
|
|
211
|
+
/** W3C-style send group object used by sendOrder/sendGroup options. */
|
|
212
|
+
export declare class WebTransportSendGroup {
|
|
213
|
+
#private;
|
|
214
|
+
constructor(transport: WebTransport, id: number);
|
|
215
|
+
_getTransport(): WebTransport;
|
|
216
|
+
_getId(): number;
|
|
217
|
+
getStats(): Promise<{
|
|
218
|
+
bytesSent?: number;
|
|
219
|
+
bytesAcknowledged?: number;
|
|
220
|
+
}>;
|
|
221
|
+
}
|
|
222
|
+
export type WebTransportReceiveStream = ReadableStream<Uint8Array> & Partial<StopSendable>;
|
|
223
|
+
interface CommonSession {
|
|
224
|
+
readonly id: string;
|
|
225
|
+
readonly peer: {
|
|
226
|
+
ip: string;
|
|
227
|
+
port: number;
|
|
228
|
+
};
|
|
229
|
+
readonly ready: Promise<void>;
|
|
230
|
+
readonly closed: Promise<CloseInfo>;
|
|
231
|
+
close(info?: CloseInfo): void;
|
|
232
|
+
sendDatagram(data: Uint8Array): Promise<void>;
|
|
233
|
+
incomingDatagrams(): AsyncIterable<Uint8Array>;
|
|
234
|
+
}
|
|
235
|
+
/** Server session surface used by createServer(onSession). */
|
|
236
|
+
export interface ServerSession extends CommonSession {
|
|
237
|
+
readonly incomingBidirectionalStreams: ReadableStream<WebTransportBidirectionalStream>;
|
|
238
|
+
readonly incomingUnidirectionalStreams: ReadableStream<WebTransportReceiveStream>;
|
|
239
|
+
createBidirectionalStream(): Promise<Duplex>;
|
|
240
|
+
createUnidirectionalStream(): Promise<Writable>;
|
|
241
|
+
metricsSnapshot(): SessionMetricsSnapshot;
|
|
242
|
+
}
|
|
243
|
+
/** Node client API session surface returned by connect(). */
|
|
244
|
+
export interface ClientSession extends CommonSession {
|
|
245
|
+
createBidirectionalStream(): Promise<Duplex>;
|
|
246
|
+
incomingBidirectionalStreams(): AsyncIterable<Duplex>;
|
|
247
|
+
createUnidirectionalStream(): Promise<Writable>;
|
|
248
|
+
incomingUnidirectionalStreams(): AsyncIterable<Readable>;
|
|
249
|
+
metricsSnapshot(): SessionMetricsSnapshot;
|
|
250
|
+
}
|
|
251
|
+
/** Latency histogram snapshot (Prometheus histogram format). */
|
|
252
|
+
export type HistogramSnapshot = {
|
|
253
|
+
le: number[];
|
|
254
|
+
cumulativeCount: number[];
|
|
255
|
+
count: number;
|
|
256
|
+
sumSecs: number;
|
|
257
|
+
};
|
|
258
|
+
export type MetricsSnapshot = {
|
|
259
|
+
nowMs: number;
|
|
260
|
+
sessionsActive: number;
|
|
261
|
+
sessionTasksActive: number;
|
|
262
|
+
streamTasksActive: number;
|
|
263
|
+
handshakesInFlight: number;
|
|
264
|
+
streamsActive: number;
|
|
265
|
+
datagramsIn: number;
|
|
266
|
+
datagramsOut: number;
|
|
267
|
+
datagramsDropped: number;
|
|
268
|
+
queuedBytesGlobal: number;
|
|
269
|
+
backpressureWaitCount: number;
|
|
270
|
+
backpressureTimeoutCount: number;
|
|
271
|
+
rateLimitedCount: number;
|
|
272
|
+
limitExceededCount: number;
|
|
273
|
+
/** Handshake latency (accept start to completion). P99 target <300ms. */
|
|
274
|
+
handshakeLatency?: HistogramSnapshot | null;
|
|
275
|
+
/** Datagram send enqueue latency. P99 target <10ms. */
|
|
276
|
+
datagramEnqueueLatency?: HistogramSnapshot | null;
|
|
277
|
+
/** Stream open latency (createBidi/createUni). P99 target <20ms. */
|
|
278
|
+
streamOpenLatency?: HistogramSnapshot | null;
|
|
279
|
+
};
|
|
280
|
+
export type SessionMetricsSnapshot = {
|
|
281
|
+
datagramsIn: number;
|
|
282
|
+
datagramsOut: number;
|
|
283
|
+
streamsActive: number;
|
|
284
|
+
queuedBytes: number;
|
|
285
|
+
};
|
|
286
|
+
/** W3C WebTransportConnectionStats shape. Unavailable stats are omitted. */
|
|
287
|
+
export type WebTransportConnectionStats = {
|
|
288
|
+
datagrams: {
|
|
289
|
+
droppedIncoming: number;
|
|
290
|
+
expiredIncoming: number;
|
|
291
|
+
expiredOutgoing: number;
|
|
292
|
+
lostOutgoing: number;
|
|
293
|
+
};
|
|
294
|
+
bytesSent?: number;
|
|
295
|
+
bytesSentOverhead?: number;
|
|
296
|
+
bytesAcknowledged?: number;
|
|
297
|
+
packetsSent?: number;
|
|
298
|
+
bytesLost?: number;
|
|
299
|
+
packetsLost?: number;
|
|
300
|
+
bytesReceived?: number;
|
|
301
|
+
packetsReceived?: number;
|
|
302
|
+
smoothedRtt?: number;
|
|
303
|
+
rttVariation?: number;
|
|
304
|
+
minRtt?: number;
|
|
305
|
+
estimatedSendRate?: number | null;
|
|
306
|
+
atSendCapacity?: boolean;
|
|
307
|
+
};
|
|
308
|
+
/** Prometheus metric name prefix. Override via env WEBTRANSPORT_METRICS_PREFIX. */
|
|
309
|
+
export declare const METRICS_PREFIX: string;
|
|
310
|
+
/**
|
|
311
|
+
* Convert MetricsSnapshot to Prometheus exposition format (text).
|
|
312
|
+
* Gauges: sessions_active, handshakes_in_flight, streams_active, session_tasks_active, stream_tasks_active, queued_bytes_global.
|
|
313
|
+
* Counters: datagrams_in, datagrams_out, datagrams_dropped, backpressure_wait_total, backpressure_timeout_total, rate_limited_total, limit_exceeded_total.
|
|
314
|
+
*
|
|
315
|
+
* @example
|
|
316
|
+
* ```ts
|
|
317
|
+
* const snapshot = server.metricsSnapshot();
|
|
318
|
+
* const text = metricsToPrometheus(snapshot, { serverId: "main" });
|
|
319
|
+
* response.end(text); // Content-Type: text/plain; version=0.0.4
|
|
320
|
+
* ```
|
|
321
|
+
*/
|
|
322
|
+
export declare function metricsToPrometheus(m: MetricsSnapshot, labels?: Record<string, string>): string;
|
|
323
|
+
/**
|
|
324
|
+
* Create an in-process WebTransport server.
|
|
325
|
+
*
|
|
326
|
+
* @param opts - Server configuration. Requires `port`, `tls` (certPem, keyPem), and `onSession` callback.
|
|
327
|
+
* @returns WebTransportServer with `address`, `close()`, and `metricsSnapshot()`.
|
|
328
|
+
* @throws Error if native addon is not loaded.
|
|
329
|
+
*
|
|
330
|
+
* @example
|
|
331
|
+
* ```ts
|
|
332
|
+
* const server = createServer({
|
|
333
|
+
* port: 4433,
|
|
334
|
+
* tls: { certPem: "...", keyPem: "..." },
|
|
335
|
+
* onSession: async (session) => {
|
|
336
|
+
* for await (const d of session.incomingDatagrams()) {
|
|
337
|
+
* await session.sendDatagram(d);
|
|
338
|
+
* }
|
|
339
|
+
* },
|
|
340
|
+
* });
|
|
341
|
+
* // server.address.port
|
|
342
|
+
* await server.close();
|
|
343
|
+
* ```
|
|
344
|
+
*/
|
|
345
|
+
export declare function createServer(opts: ServerOptions): WebTransportServer;
|
|
346
|
+
/**
|
|
347
|
+
* Connect to a WebTransport server (Node API).
|
|
348
|
+
*
|
|
349
|
+
* @param url - WebTransport URL (e.g. `https://host:port/path`).
|
|
350
|
+
* @param opts - Optional TLS, limits, and logging. Limits default per {@link DEFAULT_LIMITS}.
|
|
351
|
+
* Use `tls.insecureSkipVerify: true` only for dev; emits a warning.
|
|
352
|
+
* @returns Promise that resolves to ClientSession when handshake completes.
|
|
353
|
+
* @throws WebTransportError with code `E_HANDSHAKE_TIMEOUT` if handshake exceeds `limits.handshakeTimeoutMs` (default 10s).
|
|
354
|
+
* @throws WebTransportError with code `E_TLS` on TLS failure.
|
|
355
|
+
*
|
|
356
|
+
* @example
|
|
357
|
+
* ```ts
|
|
358
|
+
* const session = await connect("https://127.0.0.1:4433", {
|
|
359
|
+
* tls: { insecureSkipVerify: true },
|
|
360
|
+
* limits: { handshakeTimeoutMs: 5000 },
|
|
361
|
+
* });
|
|
362
|
+
* await session.ready;
|
|
363
|
+
* await session.sendDatagram(new Uint8Array([1, 2, 3]));
|
|
364
|
+
* session.close({ code: 1000, reason: "done" });
|
|
365
|
+
* ```
|
|
366
|
+
*/
|
|
367
|
+
export declare function connect(url: string, opts?: ClientOptions): Promise<ClientSession>;
|
|
368
|
+
/** Client pool metrics (hits, misses, evictions). For tests when allowPooling is used. */
|
|
369
|
+
export declare function clientPoolMetricsSnapshot(): {
|
|
370
|
+
hits: number;
|
|
371
|
+
misses: number;
|
|
372
|
+
evictIdle: number;
|
|
373
|
+
evictBroken: number;
|
|
374
|
+
};
|
|
375
|
+
/** Internal transport state for facade method guards */
|
|
376
|
+
type WebTransportState = "connecting" | "connected" | "draining" | "closed" | "failed";
|
|
377
|
+
type SendPolicy = {
|
|
378
|
+
groupId: number;
|
|
379
|
+
sendOrder: number;
|
|
380
|
+
};
|
|
381
|
+
/**
|
|
382
|
+
* Browser-style WebTransport client (W3C facade).
|
|
383
|
+
*
|
|
384
|
+
* Use `new WebTransport(url, options)` to connect, or `toWebTransport(session)` to wrap an existing
|
|
385
|
+
* {@link ClientSession}. Await {@link WebTransport.ready} before using datagrams/streams.
|
|
386
|
+
*
|
|
387
|
+
* Option semantics:
|
|
388
|
+
* - `allowPooling`: when true, endpoint-level pooling; when false, dedicated sessions.
|
|
389
|
+
* - `requireUnreliable` is accepted; runtime transport always supports unreliable delivery.
|
|
390
|
+
*
|
|
391
|
+
* @example
|
|
392
|
+
* ```ts
|
|
393
|
+
* const wt = new WebTransport("https://127.0.0.1:4433", { tls: { insecureSkipVerify: true } });
|
|
394
|
+
* await wt.ready;
|
|
395
|
+
* const { readable, writable } = await wt.createBidirectionalStream();
|
|
396
|
+
* writable.getWriter().write(new Uint8Array([1, 2, 3]));
|
|
397
|
+
* wt.close({ closeCode: 1000, reason: "done" });
|
|
398
|
+
* await wt.closed;
|
|
399
|
+
* ```
|
|
400
|
+
*/
|
|
401
|
+
export declare class WebTransport {
|
|
402
|
+
#private;
|
|
403
|
+
/** Static: true if runtime supports sessions over exclusively reliable (TCP) connections. Ours uses QUIC (supports unreliable). */
|
|
404
|
+
static readonly supportsReliableOnly = false;
|
|
405
|
+
constructor(urlOrSession: string | ClientSession, options?: WebTransportClientOptions);
|
|
406
|
+
/** Resolves when handshake completes. Rejects with WebTransportError on connect failure. */
|
|
407
|
+
get ready(): Promise<void>;
|
|
408
|
+
/** Resolves with close info when session closes. Never rejects. */
|
|
409
|
+
get closed(): Promise<WebTransportCloseInfo>;
|
|
410
|
+
/** Resolves when close() has been called and closing process has started. */
|
|
411
|
+
get draining(): Promise<void>;
|
|
412
|
+
/** Effective congestion control mode applied by this runtime. */
|
|
413
|
+
get congestionControl(): "default" | "throughput" | "low-latency";
|
|
414
|
+
/** Create a send group used by sendOrder/sendGroup options. */
|
|
415
|
+
createSendGroup(): WebTransportSendGroup;
|
|
416
|
+
/** Datagram duplex stream (W3C WebTransportDatagramDuplexStream). Throws E_SESSION_CLOSED after close. */
|
|
417
|
+
get datagrams(): WebTransportDatagramDuplexStream;
|
|
418
|
+
/** Incoming bidirectional streams as ReadableStream of { readable, writable }. */
|
|
419
|
+
get incomingBidirectionalStreams(): ReadableStream<{
|
|
420
|
+
readable: ReadableStream<Uint8Array>;
|
|
421
|
+
writable: WritableStream<Uint8Array>;
|
|
422
|
+
}>;
|
|
423
|
+
/** Incoming unidirectional streams as ReadableStream of ReadableStream. */
|
|
424
|
+
get incomingUnidirectionalStreams(): ReadableStream<ReadableStream<Uint8Array>>;
|
|
425
|
+
/**
|
|
426
|
+
* Create a bidirectional stream (Web Streams).
|
|
427
|
+
* @throws WebTransportError E_SESSION_CLOSED if session is closed/draining/failed.
|
|
428
|
+
*/
|
|
429
|
+
createBidirectionalStream(options?: {
|
|
430
|
+
sendOrder?: number;
|
|
431
|
+
sendGroup?: WebTransportSendGroup | null;
|
|
432
|
+
}): Promise<{
|
|
433
|
+
readable: ReadableStream<Uint8Array>;
|
|
434
|
+
writable: WritableStream<Uint8Array>;
|
|
435
|
+
}>;
|
|
436
|
+
/**
|
|
437
|
+
* Create a unidirectional send stream (WritableStream).
|
|
438
|
+
* @throws WebTransportError E_SESSION_CLOSED if session is closed/draining/failed.
|
|
439
|
+
*/
|
|
440
|
+
createUnidirectionalStream(options?: {
|
|
441
|
+
sendOrder?: number;
|
|
442
|
+
sendGroup?: WebTransportSendGroup | null;
|
|
443
|
+
}): Promise<WritableStream<Uint8Array>>;
|
|
444
|
+
/**
|
|
445
|
+
* Get connection stats (W3C WebTransportConnectionStats).
|
|
446
|
+
* Maps from session.metricsSnapshot(). Native exposes limited fields; unavailable stats are omitted.
|
|
447
|
+
* @throws DOMException InvalidStateError if state is "failed"
|
|
448
|
+
*/
|
|
449
|
+
getStats(): Promise<WebTransportConnectionStats>;
|
|
450
|
+
/** Initiate graceful close. Idempotent after first call. */
|
|
451
|
+
close(info?: WebTransportCloseInfo): void;
|
|
452
|
+
/** Internal: session for adapters (not part of spec) */
|
|
453
|
+
_getSession(): Promise<ClientSession>;
|
|
454
|
+
/** Internal: state for createWritable guard (not part of spec) */
|
|
455
|
+
_getState(): WebTransportState;
|
|
456
|
+
_resolveSendPolicy(options?: {
|
|
457
|
+
sendOrder?: number;
|
|
458
|
+
sendGroup?: WebTransportSendGroup | null;
|
|
459
|
+
}): SendPolicy;
|
|
460
|
+
_recordSendGroupBytes(groupId: number, bytes: number): void;
|
|
461
|
+
_getSendGroupStats(groupId: number): Promise<{
|
|
462
|
+
bytesSent?: number;
|
|
463
|
+
bytesAcknowledged?: number;
|
|
464
|
+
}>;
|
|
465
|
+
_sendDatagramWithPolicy(chunk: Uint8Array, policy: SendPolicy): Promise<void>;
|
|
466
|
+
_recordIncomingDatagram(chunk: Uint8Array): void;
|
|
467
|
+
_recordIncomingStreamBytes(bytes: number): void;
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* Wrap an existing {@link ClientSession} as a browser-style WebTransport.
|
|
471
|
+
*
|
|
472
|
+
* Use when you obtained a session via {@link connect} but want Web Streams and W3C-style API.
|
|
473
|
+
*
|
|
474
|
+
* @param session - Connected ClientSession from {@link connect}.
|
|
475
|
+
* @returns WebTransport with same lifecycle; `ready` resolves immediately if session is connected.
|
|
476
|
+
*
|
|
477
|
+
* @example
|
|
478
|
+
* ```ts
|
|
479
|
+
* const session = await connect("https://127.0.0.1:4433", { tls: { insecureSkipVerify: true } });
|
|
480
|
+
* const wt = toWebTransport(session);
|
|
481
|
+
* await wt.ready;
|
|
482
|
+
* const writer = wt.datagrams.writable.getWriter();
|
|
483
|
+
* await writer.write(new Uint8Array([1, 2, 3]));
|
|
484
|
+
* writer.releaseLock();
|
|
485
|
+
* session.close();
|
|
486
|
+
* ```
|
|
487
|
+
*/
|
|
488
|
+
export declare function toWebTransport(session: ClientSession): WebTransport;
|
|
489
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAG9D,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACzD,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EAMN,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,MAAM,cAAc,CAAC;AAEtB;;;GAGG;AACH,OAA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