@webtransport-bun/webtransport 0.2.2 → 0.2.4
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/README.md +15 -5
- package/dist/index.d.ts +42 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +303 -105
- package/dist/streams.d.ts +3 -0
- package/dist/streams.d.ts.map +1 -1
- package/dist/streams.js +116 -19
- package/package.json +6 -3
- package/prebuilds/SHA256SUMS +3 -3
- package/prebuilds/webtransport-native.darwin-arm64.node +0 -0
- package/prebuilds/webtransport-native.darwin-x64.node +0 -0
- package/prebuilds/webtransport-native.linux-x64-gnu.node +0 -0
package/README.md
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
# @webtransport-bun/webtransport
|
|
2
2
|
|
|
3
|
-
Production-focused WebTransport for Bun: datagrams + streams, in-process server/client, backed by Rust `wtransport` via `napi-rs`.
|
|
3
|
+
Production-focused WebTransport for Bun, Node, and Deno: datagrams + streams, in-process server/client, backed by Rust `wtransport` via `napi-rs`.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
bun add @webtransport-bun/webtransport
|
|
9
|
+
npm i @webtransport-bun/webtransport
|
|
10
|
+
pnpm add @webtransport-bun/webtransport
|
|
11
|
+
yarn add @webtransport-bun/webtransport
|
|
9
12
|
```
|
|
10
13
|
|
|
11
14
|
## Requirements
|
|
12
15
|
|
|
13
|
-
- **Runtime**: Bun >= 1.3.9 (
|
|
16
|
+
- **Runtime**: Bun >= 1.3.9, Node (Node-API compatible runtime), Deno (npm + Node-API addon support)
|
|
14
17
|
- **Platforms**: macOS (arm64, x64), Linux (x64)
|
|
15
18
|
|
|
16
19
|
## Quick Start
|
|
@@ -28,6 +31,9 @@ const server = createServer({
|
|
|
28
31
|
},
|
|
29
32
|
});
|
|
30
33
|
|
|
34
|
+
// Rotate TLS identity without process restart.
|
|
35
|
+
await server.updateCert({ certPem: "...next cert...", keyPem: "...next key..." });
|
|
36
|
+
|
|
31
37
|
const session = await connect("https://127.0.0.1:4433", {
|
|
32
38
|
tls: { insecureSkipVerify: true }, // dev only
|
|
33
39
|
});
|
|
@@ -42,12 +48,16 @@ session.close();
|
|
|
42
48
|
Prebuilt binaries are included for darwin-arm64, darwin-x64, and linux-x64. If you see this error:
|
|
43
49
|
|
|
44
50
|
- Ensure you are on a supported platform (macOS or Linux, arm64 or x64).
|
|
45
|
-
- Reinstall
|
|
51
|
+
- Reinstall dependencies and rebuild native artifacts (`npm i` / `pnpm i` / `yarn` / `bun install`).
|
|
46
52
|
- For development from source, run `bun run build:native` from the repo root.
|
|
47
53
|
|
|
48
|
-
###
|
|
54
|
+
### Runtime compatibility mismatch
|
|
55
|
+
|
|
56
|
+
This package supports Bun, Node, and Deno on supported OS/arch targets. If import fails:
|
|
49
57
|
|
|
50
|
-
|
|
58
|
+
- Confirm your runtime supports Node-API addon loading.
|
|
59
|
+
- Confirm your platform matches published prebuilds (macOS arm64/x64, Linux x64).
|
|
60
|
+
- If needed, build native locally from source (`bun run build:native` in this repo).
|
|
51
61
|
|
|
52
62
|
## Docs
|
|
53
63
|
|
package/dist/index.d.ts
CHANGED
|
@@ -50,6 +50,9 @@ export { E_TLS, E_HANDSHAKE_TIMEOUT, E_SESSION_CLOSED, E_SESSION_IDLE_TIMEOUT, E
|
|
|
50
50
|
export type { ErrorCode, WebTransportErrorOptions, WebTransportErrorSource, } from "./errors.js";
|
|
51
51
|
/** Web IDL BufferSource (ArrayBuffer | ArrayBufferView) for spec alignment */
|
|
52
52
|
type BufferSource = ArrayBuffer | ArrayBufferView;
|
|
53
|
+
type StreamOpenOptions = {
|
|
54
|
+
waitUntilAvailable?: boolean;
|
|
55
|
+
};
|
|
53
56
|
/** TLS configuration for server (cert/key) or client (CA, SNI). */
|
|
54
57
|
export type TlsOptions = {
|
|
55
58
|
/** PEM-encoded certificate (server) or CA (client). */
|
|
@@ -60,6 +63,8 @@ export type TlsOptions = {
|
|
|
60
63
|
caPem?: string | Uint8Array;
|
|
61
64
|
/** SNI for client mode; for server, used in logs/metrics. */
|
|
62
65
|
serverName?: string;
|
|
66
|
+
/** When true, allow empty cert/key fallback in production (dev only). */
|
|
67
|
+
allowSelfSigned?: boolean;
|
|
63
68
|
};
|
|
64
69
|
export type RateLimitOptions = {
|
|
65
70
|
handshakesPerSec: number;
|
|
@@ -130,6 +135,11 @@ export interface WebTransportServer {
|
|
|
130
135
|
host: string;
|
|
131
136
|
port: number;
|
|
132
137
|
};
|
|
138
|
+
/** Rotate server TLS certificate/key at runtime. Existing sessions are drained/closed. */
|
|
139
|
+
updateCert(tls: {
|
|
140
|
+
certPem: string | Uint8Array;
|
|
141
|
+
keyPem: string | Uint8Array;
|
|
142
|
+
}): Promise<void>;
|
|
133
143
|
close(): Promise<void>;
|
|
134
144
|
metricsSnapshot(): MetricsSnapshot;
|
|
135
145
|
}
|
|
@@ -236,15 +246,15 @@ interface CommonSession {
|
|
|
236
246
|
export interface ServerSession extends CommonSession {
|
|
237
247
|
readonly incomingBidirectionalStreams: ReadableStream<WebTransportBidirectionalStream>;
|
|
238
248
|
readonly incomingUnidirectionalStreams: ReadableStream<WebTransportReceiveStream>;
|
|
239
|
-
createBidirectionalStream(): Promise<Duplex>;
|
|
240
|
-
createUnidirectionalStream(): Promise<Writable>;
|
|
249
|
+
createBidirectionalStream(options?: StreamOpenOptions): Promise<Duplex>;
|
|
250
|
+
createUnidirectionalStream(options?: StreamOpenOptions): Promise<Writable>;
|
|
241
251
|
metricsSnapshot(): SessionMetricsSnapshot;
|
|
242
252
|
}
|
|
243
253
|
/** Node client API session surface returned by connect(). */
|
|
244
254
|
export interface ClientSession extends CommonSession {
|
|
245
|
-
createBidirectionalStream(): Promise<Duplex>;
|
|
255
|
+
createBidirectionalStream(options?: StreamOpenOptions): Promise<Duplex>;
|
|
246
256
|
incomingBidirectionalStreams(): AsyncIterable<Duplex>;
|
|
247
|
-
createUnidirectionalStream(): Promise<Writable>;
|
|
257
|
+
createUnidirectionalStream(options?: StreamOpenOptions): Promise<Writable>;
|
|
248
258
|
incomingUnidirectionalStreams(): AsyncIterable<Readable>;
|
|
249
259
|
metricsSnapshot(): SessionMetricsSnapshot;
|
|
250
260
|
}
|
|
@@ -320,11 +330,21 @@ export declare const METRICS_PREFIX: string;
|
|
|
320
330
|
* ```
|
|
321
331
|
*/
|
|
322
332
|
export declare function metricsToPrometheus(m: MetricsSnapshot, labels?: Record<string, string>): string;
|
|
333
|
+
type RequireLike = (id: string) => unknown;
|
|
334
|
+
type NativeLoadFailure = {
|
|
335
|
+
request: string;
|
|
336
|
+
message: string;
|
|
337
|
+
};
|
|
338
|
+
declare function tryLoadNativeAddon(requireFn: RequireLike, bases?: string[], candidates?: string[]): {
|
|
339
|
+
addon: any;
|
|
340
|
+
failures: NativeLoadFailure[];
|
|
341
|
+
};
|
|
342
|
+
declare function buildNativeAddonLoadErrorMessage(failures: NativeLoadFailure[], maxEntries?: number): string;
|
|
323
343
|
/**
|
|
324
344
|
* Create an in-process WebTransport server.
|
|
325
345
|
*
|
|
326
346
|
* @param opts - Server configuration. Requires `port`, `tls` (certPem, keyPem), and `onSession` callback.
|
|
327
|
-
* @returns WebTransportServer with `address`, `close()`, and `metricsSnapshot()`.
|
|
347
|
+
* @returns WebTransportServer with `address`, `updateCert()`, `close()`, and `metricsSnapshot()`.
|
|
328
348
|
* @throws Error if native addon is not loaded.
|
|
329
349
|
*
|
|
330
350
|
* @example
|
|
@@ -343,6 +363,7 @@ export declare function metricsToPrometheus(m: MetricsSnapshot, labels?: Record<
|
|
|
343
363
|
* ```
|
|
344
364
|
*/
|
|
345
365
|
export declare function createServer(opts: ServerOptions): WebTransportServer;
|
|
366
|
+
declare function connectWithNative(native: any, url: string, optsJson: string, handshakeTimeout: number, strictW3CErrors?: boolean, streamOpenWaitTimeoutMs?: number, setTimer?: (cb: () => void, ms: number) => any, clearTimer?: (handle: any) => void): Promise<ClientSession>;
|
|
346
367
|
/**
|
|
347
368
|
* Connect to a WebTransport server (Node API).
|
|
348
369
|
*
|
|
@@ -429,6 +450,7 @@ export declare class WebTransport {
|
|
|
429
450
|
createBidirectionalStream(options?: {
|
|
430
451
|
sendOrder?: number;
|
|
431
452
|
sendGroup?: WebTransportSendGroup | null;
|
|
453
|
+
waitUntilAvailable?: boolean;
|
|
432
454
|
}): Promise<{
|
|
433
455
|
readable: ReadableStream<Uint8Array>;
|
|
434
456
|
writable: WritableStream<Uint8Array>;
|
|
@@ -440,6 +462,7 @@ export declare class WebTransport {
|
|
|
440
462
|
createUnidirectionalStream(options?: {
|
|
441
463
|
sendOrder?: number;
|
|
442
464
|
sendGroup?: WebTransportSendGroup | null;
|
|
465
|
+
waitUntilAvailable?: boolean;
|
|
443
466
|
}): Promise<WritableStream<Uint8Array>>;
|
|
444
467
|
/**
|
|
445
468
|
* Get connection stats (W3C WebTransportConnectionStats).
|
|
@@ -456,6 +479,7 @@ export declare class WebTransport {
|
|
|
456
479
|
_resolveSendPolicy(options?: {
|
|
457
480
|
sendOrder?: number;
|
|
458
481
|
sendGroup?: WebTransportSendGroup | null;
|
|
482
|
+
waitUntilAvailable?: boolean;
|
|
459
483
|
}): SendPolicy;
|
|
460
484
|
_recordSendGroupBytes(groupId: number, bytes: number): void;
|
|
461
485
|
_getSendGroupStats(groupId: number): Promise<{
|
|
@@ -466,6 +490,19 @@ export declare class WebTransport {
|
|
|
466
490
|
_recordIncomingDatagram(chunk: Uint8Array): void;
|
|
467
491
|
_recordIncomingStreamBytes(bytes: number): void;
|
|
468
492
|
}
|
|
493
|
+
declare function createServerIncomingBidiStreams(nativeHandle: any, isClosed: () => boolean): ReadableStream<WebTransportBidirectionalStream>;
|
|
494
|
+
declare function createServerIncomingUniStreams(nativeHandle: any, isClosed: () => boolean): ReadableStream<WebTransportReceiveStream>;
|
|
495
|
+
declare function createNativeClientSessionForTests(nativeHandle: any, strictW3CErrors?: boolean): ClientSession;
|
|
496
|
+
declare function createNativeServerSessionForTests(nativeHandle: any): ServerSession;
|
|
497
|
+
export declare const __TESTING__: {
|
|
498
|
+
createNativeClientSessionForTests: typeof createNativeClientSessionForTests;
|
|
499
|
+
createNativeServerSessionForTests: typeof createNativeServerSessionForTests;
|
|
500
|
+
createServerIncomingBidiStreamsForTests: typeof createServerIncomingBidiStreams;
|
|
501
|
+
createServerIncomingUniStreamsForTests: typeof createServerIncomingUniStreams;
|
|
502
|
+
tryLoadNativeAddonForTests: typeof tryLoadNativeAddon;
|
|
503
|
+
buildNativeAddonLoadErrorMessageForTests: typeof buildNativeAddonLoadErrorMessage;
|
|
504
|
+
connectWithNativeForTests: typeof connectWithNative;
|
|
505
|
+
};
|
|
469
506
|
/**
|
|
470
507
|
* Wrap an existing {@link ClientSession} as a browser-style WebTransport.
|
|
471
508
|
*
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +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,OAAO,EACN,KAAK,EACL,mBAAmB,EACnB,gBAAgB,EAChB,sBAAsB,EACtB,cAAc,EACd,cAAc,EACd,YAAY,EACZ,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,iBAAiB,GACjB,MAAM,aAAa,CAAC;AACrB,YAAY,EACX,SAAS,EACT,wBAAwB,EACxB,uBAAuB,GACvB,MAAM,aAAa,CAA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G,IAAI;IAOrD,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAClD,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC3B,CAAC;IAMI,uBAAuB,CAC5B,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,UAAU,GAChB,OAAO,CAAC,IAAI,CAAC;IAUhB,uBAAuB,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAKhD,0BAA0B,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;CAG/C;AA6HD,iBAAS,+BAA+B,CACvC,YAAY,EAAE,GAAG,EACjB,QAAQ,EAAE,MAAM,OAAO,GACrB,cAAc,CAAC,+BAA+B,CAAC,CAuBjD;AAED,iBAAS,8BAA8B,CACtC,YAAY,EAAE,GAAG,EACjB,QAAQ,EAAE,MAAM,OAAO,GACrB,cAAc,CAAC,yBAAyB,CAAC,CA0B3C;AAyID,iBAAS,iCAAiC,CACzC,YAAY,EAAE,GAAG,EACjB,eAAe,UAAQ,GACrB,aAAa,CAOf;AAED,iBAAS,iCAAiC,CAAC,YAAY,EAAE,GAAG,GAAG,aAAa,CAM3E;AAED,eAAO,MAAM,WAAW;;;;;;;;CAQvB,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,aAAa,GAAG,YAAY,CAEnE"}
|
package/dist/index.js
CHANGED
|
@@ -13,8 +13,10 @@ import { BidiStream, RecvStream, SendStream, WT_RESET, WT_STOP_SENDING, } from "
|
|
|
13
13
|
* @see WebTransportError
|
|
14
14
|
*/
|
|
15
15
|
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";
|
|
16
|
-
import { E_INTERNAL, E_HANDSHAKE_TIMEOUT, E_SESSION_CLOSED, WebTransportError, } from "./errors.js";
|
|
16
|
+
import { E_TLS, E_INTERNAL, E_HANDSHAKE_TIMEOUT, E_LIMIT_EXCEEDED, E_QUEUE_FULL, E_BACKPRESSURE_TIMEOUT, E_SESSION_CLOSED, E_SESSION_IDLE_TIMEOUT, WebTransportError, } from "./errors.js";
|
|
17
17
|
const E_CODE_RE = /E_[A-Z_]+/g;
|
|
18
|
+
const SUPPRESS_LOG_CALLBACK_WARN = process.env.WEBTRANSPORT_SUPPRESS_LOG_CALLBACK_WARN === "1";
|
|
19
|
+
const SUPPRESS_READY_REJECTION_WARN = process.env.WEBTRANSPORT_SUPPRESS_READY_REJECTION_WARN === "1";
|
|
18
20
|
/**
|
|
19
21
|
* Maps known validation/connect failures to browser-style DOMException names.
|
|
20
22
|
* Returns undefined for unknown cases; E_* code is always preserved.
|
|
@@ -51,6 +53,67 @@ function toWebTransportError(err, strictW3CErrors) {
|
|
|
51
53
|
const browserName = strictW3CErrors === true ? normalizeToBrowserName(code, msg) : undefined;
|
|
52
54
|
return new WebTransportError(code, msg, browserName ? { browserName } : undefined);
|
|
53
55
|
}
|
|
56
|
+
function isSessionCloseError(err) {
|
|
57
|
+
const mapped = toWebTransportError(err);
|
|
58
|
+
if (mapped.code === E_SESSION_CLOSED ||
|
|
59
|
+
mapped.code === E_SESSION_IDLE_TIMEOUT) {
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
63
|
+
const lower = msg.toLowerCase();
|
|
64
|
+
// Native transports can report close without E_* code (e.g. "connection locally closed").
|
|
65
|
+
return (lower.includes("connection locally closed") ||
|
|
66
|
+
lower.includes("connection closed by peer"));
|
|
67
|
+
}
|
|
68
|
+
function shouldRetryStreamOpen(err) {
|
|
69
|
+
const mapped = toWebTransportError(err);
|
|
70
|
+
return (mapped.code === E_LIMIT_EXCEEDED ||
|
|
71
|
+
mapped.code === E_QUEUE_FULL ||
|
|
72
|
+
mapped.code === E_BACKPRESSURE_TIMEOUT);
|
|
73
|
+
}
|
|
74
|
+
function parseWaitUntilAvailable(options) {
|
|
75
|
+
const value = options?.waitUntilAvailable;
|
|
76
|
+
if (value === undefined)
|
|
77
|
+
return false;
|
|
78
|
+
if (typeof value !== "boolean") {
|
|
79
|
+
throw new TypeError("waitUntilAvailable must be a boolean");
|
|
80
|
+
}
|
|
81
|
+
return value;
|
|
82
|
+
}
|
|
83
|
+
async function openStreamWithWait(openFn, options, backpressureTimeoutMs, isClosed, waitForCapacity, strictW3CErrors) {
|
|
84
|
+
const waitUntilAvailable = parseWaitUntilAvailable(options);
|
|
85
|
+
if (!waitUntilAvailable) {
|
|
86
|
+
return openFn();
|
|
87
|
+
}
|
|
88
|
+
const timeoutMs = Math.max(1, backpressureTimeoutMs);
|
|
89
|
+
const deadline = Date.now() + timeoutMs;
|
|
90
|
+
let backoffMs = 2;
|
|
91
|
+
while (true) {
|
|
92
|
+
if (isClosed()) {
|
|
93
|
+
throw new WebTransportError(E_SESSION_CLOSED);
|
|
94
|
+
}
|
|
95
|
+
try {
|
|
96
|
+
return await openFn();
|
|
97
|
+
}
|
|
98
|
+
catch (err) {
|
|
99
|
+
if (!shouldRetryStreamOpen(err)) {
|
|
100
|
+
throw toWebTransportError(err, strictW3CErrors);
|
|
101
|
+
}
|
|
102
|
+
if (Date.now() >= deadline) {
|
|
103
|
+
throw new WebTransportError(E_BACKPRESSURE_TIMEOUT, `E_BACKPRESSURE_TIMEOUT: waitUntilAvailable timed out after ${timeoutMs}ms`);
|
|
104
|
+
}
|
|
105
|
+
const remaining = Math.max(0, deadline - Date.now());
|
|
106
|
+
if (waitForCapacity) {
|
|
107
|
+
await waitForCapacity(Math.max(1, remaining));
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
const sleepMs = Math.max(1, Math.min(backoffMs, remaining));
|
|
111
|
+
await Bun.sleep(sleepMs);
|
|
112
|
+
backoffMs = Math.min(backoffMs * 2, 64);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
54
117
|
/** Default limit values from AGENTS.md */
|
|
55
118
|
export const DEFAULT_LIMITS = {
|
|
56
119
|
maxSessions: 2000,
|
|
@@ -218,25 +281,47 @@ import { createRequire } from "node:module";
|
|
|
218
281
|
const _require = createRequire(import.meta.url);
|
|
219
282
|
const PLATFORM = process.platform;
|
|
220
283
|
const ARCH = process.arch;
|
|
221
|
-
let native;
|
|
222
284
|
const binaryCandidates = [
|
|
223
285
|
`webtransport-native.${PLATFORM}-${ARCH}.node`,
|
|
224
286
|
`webtransport-native.${PLATFORM}-${ARCH}-gnu.node`,
|
|
225
287
|
`webtransport-native.${PLATFORM}-${ARCH}-musl.node`,
|
|
226
288
|
];
|
|
227
289
|
const basePaths = ["../../../crates/native", "../prebuilds"];
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
290
|
+
function tryLoadNativeAddon(requireFn, bases = basePaths, candidates = binaryCandidates) {
|
|
291
|
+
const failures = [];
|
|
292
|
+
for (const base of bases) {
|
|
293
|
+
for (const candidate of candidates) {
|
|
294
|
+
const request = `${base}/${candidate}`;
|
|
295
|
+
try {
|
|
296
|
+
return { addon: requireFn(request), failures };
|
|
297
|
+
}
|
|
298
|
+
catch (err) {
|
|
299
|
+
failures.push({
|
|
300
|
+
request,
|
|
301
|
+
message: err instanceof Error ? err.message : String(err),
|
|
302
|
+
});
|
|
303
|
+
}
|
|
236
304
|
}
|
|
237
305
|
}
|
|
306
|
+
return { addon: undefined, failures };
|
|
307
|
+
}
|
|
308
|
+
function buildNativeAddonLoadErrorMessage(failures, maxEntries = 6) {
|
|
309
|
+
if (failures.length === 0) {
|
|
310
|
+
return "Native addon not loaded; no load attempts were recorded.";
|
|
311
|
+
}
|
|
312
|
+
const shown = failures.slice(0, maxEntries);
|
|
313
|
+
const details = shown.map((f) => `- ${f.request}: ${f.message}`).join("\n");
|
|
314
|
+
const omitted = failures.length - shown.length;
|
|
315
|
+
const suffix = omitted > 0 ? `\n- ... and ${omitted} more attempt(s)` : "";
|
|
316
|
+
return `Native addon not loaded. Candidate load errors:\n${details}${suffix}`;
|
|
317
|
+
}
|
|
318
|
+
const nativeLoad = tryLoadNativeAddon(_require);
|
|
319
|
+
const native = nativeLoad.addon;
|
|
320
|
+
const nativeLoadFailures = nativeLoad.failures;
|
|
321
|
+
function getNativeOrThrow() {
|
|
238
322
|
if (native)
|
|
239
|
-
|
|
323
|
+
return native;
|
|
324
|
+
throw new Error(buildNativeAddonLoadErrorMessage(nativeLoadFailures));
|
|
240
325
|
}
|
|
241
326
|
// ---------------------------------------------------------------------------
|
|
242
327
|
// Server session implementation
|
|
@@ -246,10 +331,12 @@ class NativeServerSession {
|
|
|
246
331
|
#closedPromise;
|
|
247
332
|
#closed = false;
|
|
248
333
|
#requestedCloseInfo = null;
|
|
334
|
+
#streamOpenWaitTimeoutMs;
|
|
249
335
|
#incomingBidiCache = null;
|
|
250
336
|
#incomingUniCache = null;
|
|
251
|
-
constructor(nativeHandle, closedPromise) {
|
|
337
|
+
constructor(nativeHandle, closedPromise, streamOpenWaitTimeoutMs) {
|
|
252
338
|
this.#nativeHandle = nativeHandle;
|
|
339
|
+
this.#streamOpenWaitTimeoutMs = streamOpenWaitTimeoutMs;
|
|
253
340
|
this.#closedPromise = closedPromise.then((info) => normalizeCloseInfo(info, this.#requestedCloseInfo ?? undefined));
|
|
254
341
|
this.#closedPromise.then(() => {
|
|
255
342
|
this.#closed = true;
|
|
@@ -297,16 +384,20 @@ class NativeServerSession {
|
|
|
297
384
|
break;
|
|
298
385
|
yield datagram;
|
|
299
386
|
}
|
|
300
|
-
catch {
|
|
301
|
-
|
|
387
|
+
catch (err) {
|
|
388
|
+
if (isSessionCloseError(err))
|
|
389
|
+
break;
|
|
390
|
+
throw toWebTransportError(err);
|
|
302
391
|
}
|
|
303
392
|
}
|
|
304
393
|
}
|
|
305
|
-
async createBidirectionalStream() {
|
|
394
|
+
async createBidirectionalStream(options) {
|
|
306
395
|
if (this.#closed)
|
|
307
396
|
throw new WebTransportError(E_SESSION_CLOSED);
|
|
308
397
|
try {
|
|
309
|
-
const nativeStream = await this.#nativeHandle.createBidiStream()
|
|
398
|
+
const nativeStream = (await openStreamWithWait(() => this.#nativeHandle.createBidiStream(), options, this.#streamOpenWaitTimeoutMs, () => this.#closed, typeof this.#nativeHandle.waitBidiCapacity === "function"
|
|
399
|
+
? (remainingMs) => this.#nativeHandle.waitBidiCapacity(remainingMs)
|
|
400
|
+
: undefined));
|
|
310
401
|
return new BidiStream({
|
|
311
402
|
handleId: nativeStream?.id ?? 0,
|
|
312
403
|
nativeHandle: nativeStream,
|
|
@@ -322,11 +413,13 @@ class NativeServerSession {
|
|
|
322
413
|
}
|
|
323
414
|
return this.#incomingBidiCache;
|
|
324
415
|
}
|
|
325
|
-
async createUnidirectionalStream() {
|
|
416
|
+
async createUnidirectionalStream(options) {
|
|
326
417
|
if (this.#closed)
|
|
327
418
|
throw new WebTransportError(E_SESSION_CLOSED);
|
|
328
419
|
try {
|
|
329
|
-
const nativeStream = await this.#nativeHandle.createUniStream()
|
|
420
|
+
const nativeStream = (await openStreamWithWait(() => this.#nativeHandle.createUniStream(), options, this.#streamOpenWaitTimeoutMs, () => this.#closed, typeof this.#nativeHandle.waitUniCapacity === "function"
|
|
421
|
+
? (remainingMs) => this.#nativeHandle.waitUniCapacity(remainingMs)
|
|
422
|
+
: undefined));
|
|
330
423
|
return new SendStream({
|
|
331
424
|
handleId: nativeStream?.id ?? 0,
|
|
332
425
|
nativeHandle: nativeStream,
|
|
@@ -353,7 +446,7 @@ class NativeServerSession {
|
|
|
353
446
|
* Create an in-process WebTransport server.
|
|
354
447
|
*
|
|
355
448
|
* @param opts - Server configuration. Requires `port`, `tls` (certPem, keyPem), and `onSession` callback.
|
|
356
|
-
* @returns WebTransportServer with `address`, `close()`, and `metricsSnapshot()`.
|
|
449
|
+
* @returns WebTransportServer with `address`, `updateCert()`, `close()`, and `metricsSnapshot()`.
|
|
357
450
|
* @throws Error if native addon is not loaded.
|
|
358
451
|
*
|
|
359
452
|
* @example
|
|
@@ -372,21 +465,25 @@ class NativeServerSession {
|
|
|
372
465
|
* ```
|
|
373
466
|
*/
|
|
374
467
|
export function createServer(opts) {
|
|
375
|
-
|
|
376
|
-
throw new Error("Native addon not loaded");
|
|
377
|
-
}
|
|
468
|
+
const native = getNativeOrThrow();
|
|
378
469
|
const certPem = typeof opts.tls.certPem === "string"
|
|
379
470
|
? opts.tls.certPem
|
|
380
471
|
: new TextDecoder().decode(opts.tls.certPem);
|
|
381
472
|
const keyPem = typeof opts.tls.keyPem === "string"
|
|
382
473
|
? opts.tls.keyPem
|
|
383
474
|
: new TextDecoder().decode(opts.tls.keyPem);
|
|
475
|
+
if (process.env.NODE_ENV === "production" &&
|
|
476
|
+
opts.tls.allowSelfSigned !== true &&
|
|
477
|
+
(certPem.trim().length === 0 || keyPem.trim().length === 0)) {
|
|
478
|
+
throw new WebTransportError(E_TLS, "E_TLS: empty certPem/keyPem is not allowed in production (set tls.allowSelfSigned=true to override)");
|
|
479
|
+
}
|
|
384
480
|
const caPem = typeof opts.tls.caPem === "string"
|
|
385
481
|
? opts.tls.caPem
|
|
386
482
|
: opts.tls.caPem != null
|
|
387
483
|
? new TextDecoder().decode(opts.tls.caPem)
|
|
388
484
|
: "";
|
|
389
|
-
const
|
|
485
|
+
const mergedLimits = { ...DEFAULT_LIMITS, ...opts.limits };
|
|
486
|
+
const limitsJson = JSON.stringify(mergedLimits);
|
|
390
487
|
const rateLimitsJson = JSON.stringify({
|
|
391
488
|
...DEFAULT_RATE_LIMITS,
|
|
392
489
|
...opts.rateLimits,
|
|
@@ -394,19 +491,30 @@ export function createServer(opts) {
|
|
|
394
491
|
const closedResolvers = new Map();
|
|
395
492
|
let activeOnSessionCallbacks = 0;
|
|
396
493
|
let onSessionDrainResolve = null;
|
|
397
|
-
const
|
|
398
|
-
if (opts.log)
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
});
|
|
494
|
+
const emitUserLog = (event) => {
|
|
495
|
+
if (!opts.log)
|
|
496
|
+
return;
|
|
497
|
+
try {
|
|
498
|
+
opts.log(event);
|
|
499
|
+
}
|
|
500
|
+
catch (err) {
|
|
501
|
+
if (!SUPPRESS_LOG_CALLBACK_WARN) {
|
|
502
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
503
|
+
console.warn(`[webtransport] log callback failed: ${msg}`);
|
|
407
504
|
}
|
|
408
505
|
}
|
|
409
506
|
};
|
|
507
|
+
const logCallback = (logEvents) => {
|
|
508
|
+
for (const le of logEvents) {
|
|
509
|
+
emitUserLog({
|
|
510
|
+
level: le.level ?? "info",
|
|
511
|
+
msg: le.msg ?? "",
|
|
512
|
+
sessionId: le.sessionId,
|
|
513
|
+
peerIp: le.peerIp,
|
|
514
|
+
peerPort: le.peerPort,
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
};
|
|
410
518
|
const handle = new native.ServerHandle(opts.port, opts.host ?? "0.0.0.0", opts.debug === true, certPem, keyPem, caPem, limitsJson, rateLimitsJson, (events) => {
|
|
411
519
|
for (const evt of events) {
|
|
412
520
|
if (evt.name === "session" &&
|
|
@@ -419,11 +527,36 @@ export function createServer(opts) {
|
|
|
419
527
|
});
|
|
420
528
|
closedResolvers.set(evt.id, closedResolve);
|
|
421
529
|
const nativeSession = new native.SessionHandle(evt.id, evt.peerIp, evt.peerPort);
|
|
422
|
-
const session = new NativeServerSession(nativeSession, closedPromise);
|
|
530
|
+
const session = new NativeServerSession(nativeSession, closedPromise, mergedLimits.backpressureTimeoutMs);
|
|
423
531
|
activeOnSessionCallbacks++;
|
|
424
|
-
|
|
532
|
+
let maybePromise;
|
|
533
|
+
try {
|
|
534
|
+
maybePromise = opts.onSession(session);
|
|
535
|
+
}
|
|
536
|
+
catch (err) {
|
|
537
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
538
|
+
emitUserLog({
|
|
539
|
+
level: "error",
|
|
540
|
+
msg: `E_INTERNAL: onSession callback threw: ${msg}`,
|
|
541
|
+
sessionId: evt.id,
|
|
542
|
+
peerIp: evt.peerIp,
|
|
543
|
+
peerPort: evt.peerPort,
|
|
544
|
+
});
|
|
545
|
+
onSessionCallbackDone();
|
|
546
|
+
continue;
|
|
547
|
+
}
|
|
425
548
|
if (maybePromise && typeof maybePromise.then === "function") {
|
|
426
|
-
maybePromise.then(onSessionCallbackDone,
|
|
549
|
+
maybePromise.then(onSessionCallbackDone, (err) => {
|
|
550
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
551
|
+
emitUserLog({
|
|
552
|
+
level: "error",
|
|
553
|
+
msg: `E_INTERNAL: onSession callback rejected: ${msg}`,
|
|
554
|
+
sessionId: evt.id,
|
|
555
|
+
peerIp: evt.peerIp,
|
|
556
|
+
peerPort: evt.peerPort,
|
|
557
|
+
});
|
|
558
|
+
onSessionCallbackDone();
|
|
559
|
+
});
|
|
427
560
|
}
|
|
428
561
|
else {
|
|
429
562
|
onSessionCallbackDone();
|
|
@@ -446,6 +579,15 @@ export function createServer(opts) {
|
|
|
446
579
|
}
|
|
447
580
|
return {
|
|
448
581
|
address: { host: opts.host ?? "0.0.0.0", port: handle.port },
|
|
582
|
+
updateCert: async (tls) => {
|
|
583
|
+
const nextCertPem = typeof tls.certPem === "string"
|
|
584
|
+
? tls.certPem
|
|
585
|
+
: new TextDecoder().decode(tls.certPem);
|
|
586
|
+
const nextKeyPem = typeof tls.keyPem === "string"
|
|
587
|
+
? tls.keyPem
|
|
588
|
+
: new TextDecoder().decode(tls.keyPem);
|
|
589
|
+
await handle.updateCert(nextCertPem, nextKeyPem);
|
|
590
|
+
},
|
|
449
591
|
close: async () => {
|
|
450
592
|
await handle.close();
|
|
451
593
|
for (const [id, resolve] of closedResolvers) {
|
|
@@ -474,11 +616,13 @@ class NativeClientSession {
|
|
|
474
616
|
#closed = false;
|
|
475
617
|
#requestedCloseInfo = null;
|
|
476
618
|
#strictW3CErrors;
|
|
477
|
-
|
|
619
|
+
#streamOpenWaitTimeoutMs;
|
|
620
|
+
constructor(nativeHandle, readyPromise, closedPromise, strictW3CErrors = false, streamOpenWaitTimeoutMs = DEFAULT_LIMITS.backpressureTimeoutMs) {
|
|
478
621
|
this.#nativeHandle = nativeHandle;
|
|
479
622
|
this.#readyPromise = readyPromise;
|
|
480
623
|
this.#closedPromise = closedPromise.then((info) => normalizeCloseInfo(info, this.#requestedCloseInfo ?? undefined));
|
|
481
624
|
this.#strictW3CErrors = strictW3CErrors;
|
|
625
|
+
this.#streamOpenWaitTimeoutMs = streamOpenWaitTimeoutMs;
|
|
482
626
|
this.#closedPromise.then(() => {
|
|
483
627
|
this.#closed = true;
|
|
484
628
|
});
|
|
@@ -524,16 +668,18 @@ class NativeClientSession {
|
|
|
524
668
|
break;
|
|
525
669
|
yield dgram;
|
|
526
670
|
}
|
|
527
|
-
catch {
|
|
528
|
-
|
|
671
|
+
catch (err) {
|
|
672
|
+
if (isSessionCloseError(err))
|
|
673
|
+
break;
|
|
674
|
+
throw toWebTransportError(err, this.#strictW3CErrors);
|
|
529
675
|
}
|
|
530
676
|
}
|
|
531
677
|
}
|
|
532
|
-
async createBidirectionalStream() {
|
|
678
|
+
async createBidirectionalStream(options) {
|
|
533
679
|
if (this.#closed)
|
|
534
680
|
throw new WebTransportError(E_SESSION_CLOSED);
|
|
535
681
|
try {
|
|
536
|
-
const nativeStream = await this.#nativeHandle.createBidiStream();
|
|
682
|
+
const nativeStream = (await openStreamWithWait(() => this.#nativeHandle.createBidiStream(), options, this.#streamOpenWaitTimeoutMs, () => this.#closed, undefined, this.#strictW3CErrors));
|
|
537
683
|
return new BidiStream({
|
|
538
684
|
handleId: nativeStream?.id ?? 0,
|
|
539
685
|
nativeHandle: nativeStream,
|
|
@@ -554,16 +700,18 @@ class NativeClientSession {
|
|
|
554
700
|
nativeHandle: nativeStream,
|
|
555
701
|
});
|
|
556
702
|
}
|
|
557
|
-
catch {
|
|
558
|
-
|
|
703
|
+
catch (err) {
|
|
704
|
+
if (isSessionCloseError(err))
|
|
705
|
+
break;
|
|
706
|
+
throw toWebTransportError(err, this.#strictW3CErrors);
|
|
559
707
|
}
|
|
560
708
|
}
|
|
561
709
|
}
|
|
562
|
-
async createUnidirectionalStream() {
|
|
710
|
+
async createUnidirectionalStream(options) {
|
|
563
711
|
if (this.#closed)
|
|
564
712
|
throw new WebTransportError(E_SESSION_CLOSED);
|
|
565
713
|
try {
|
|
566
|
-
const nativeStream = await this.#nativeHandle.createUniStream();
|
|
714
|
+
const nativeStream = (await openStreamWithWait(() => this.#nativeHandle.createUniStream(), options, this.#streamOpenWaitTimeoutMs, () => this.#closed, undefined, this.#strictW3CErrors));
|
|
567
715
|
return new SendStream({
|
|
568
716
|
handleId: nativeStream?.id ?? 0,
|
|
569
717
|
nativeHandle: nativeStream,
|
|
@@ -584,8 +732,10 @@ class NativeClientSession {
|
|
|
584
732
|
nativeHandle: nativeStream,
|
|
585
733
|
});
|
|
586
734
|
}
|
|
587
|
-
catch {
|
|
588
|
-
|
|
735
|
+
catch (err) {
|
|
736
|
+
if (isSessionCloseError(err))
|
|
737
|
+
break;
|
|
738
|
+
throw toWebTransportError(err, this.#strictW3CErrors);
|
|
589
739
|
}
|
|
590
740
|
}
|
|
591
741
|
}
|
|
@@ -596,6 +746,76 @@ class NativeClientSession {
|
|
|
596
746
|
// ---------------------------------------------------------------------------
|
|
597
747
|
// connect
|
|
598
748
|
// ---------------------------------------------------------------------------
|
|
749
|
+
function connectWithNative(native, url, optsJson, handshakeTimeout, strictW3CErrors, streamOpenWaitTimeoutMs = DEFAULT_LIMITS.backpressureTimeoutMs, setTimer = (cb, ms) => setTimeout(cb, ms), clearTimer = (handle) => clearTimeout(handle)) {
|
|
750
|
+
return new Promise((resolve, reject) => {
|
|
751
|
+
const closedResolvers = new Map();
|
|
752
|
+
let settled = false;
|
|
753
|
+
let timeoutHandle;
|
|
754
|
+
const settleResolve = (session) => {
|
|
755
|
+
if (settled)
|
|
756
|
+
return;
|
|
757
|
+
settled = true;
|
|
758
|
+
clearTimer(timeoutHandle);
|
|
759
|
+
resolve(session);
|
|
760
|
+
};
|
|
761
|
+
const settleReject = (err) => {
|
|
762
|
+
if (settled)
|
|
763
|
+
return;
|
|
764
|
+
settled = true;
|
|
765
|
+
clearTimer(timeoutHandle);
|
|
766
|
+
reject(err);
|
|
767
|
+
};
|
|
768
|
+
const onClosed = (events) => {
|
|
769
|
+
for (const evt of events) {
|
|
770
|
+
if (evt.name === "session_closed" && evt.id != null) {
|
|
771
|
+
const resolveClosed = closedResolvers.get(evt.id);
|
|
772
|
+
closedResolvers.delete(evt.id);
|
|
773
|
+
if (resolveClosed)
|
|
774
|
+
resolveClosed({ code: evt.code, reason: evt.reason });
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
};
|
|
778
|
+
timeoutHandle = setTimer(() => {
|
|
779
|
+
const msg = `E_HANDSHAKE_TIMEOUT: connect timed out after ${handshakeTimeout}ms`;
|
|
780
|
+
const browserName = strictW3CErrors === true
|
|
781
|
+
? (normalizeToBrowserName(E_HANDSHAKE_TIMEOUT, msg) ??
|
|
782
|
+
undefined)
|
|
783
|
+
: undefined;
|
|
784
|
+
settleReject(new WebTransportError(E_HANDSHAKE_TIMEOUT, msg, browserName ? { browserName } : undefined));
|
|
785
|
+
}, handshakeTimeout);
|
|
786
|
+
native.connect(url, optsJson, onClosed, (err, handleId) => {
|
|
787
|
+
if (err) {
|
|
788
|
+
settleReject(toWebTransportError(err, strictW3CErrors));
|
|
789
|
+
return;
|
|
790
|
+
}
|
|
791
|
+
if (handleId == null) {
|
|
792
|
+
settleReject(new Error("connect succeeded but no handle id"));
|
|
793
|
+
return;
|
|
794
|
+
}
|
|
795
|
+
const handle = native.takeClientSession(handleId);
|
|
796
|
+
if (!handle) {
|
|
797
|
+
settleReject(new Error("connect: handle not found in registry"));
|
|
798
|
+
return;
|
|
799
|
+
}
|
|
800
|
+
if (settled) {
|
|
801
|
+
try {
|
|
802
|
+
handle.close?.(0, "late connect completion after timeout");
|
|
803
|
+
}
|
|
804
|
+
catch (closeErr) {
|
|
805
|
+
const msg = closeErr instanceof Error ? closeErr.message : String(closeErr);
|
|
806
|
+
console.warn(`[webtransport] late connect orphan cleanup failed: ${msg}`);
|
|
807
|
+
}
|
|
808
|
+
return;
|
|
809
|
+
}
|
|
810
|
+
let closedResolve;
|
|
811
|
+
const closedPromise = new Promise((r) => {
|
|
812
|
+
closedResolve = r;
|
|
813
|
+
});
|
|
814
|
+
closedResolvers.set(handle.id, closedResolve);
|
|
815
|
+
settleResolve(new NativeClientSession(handle, Promise.resolve(), closedPromise, strictW3CErrors, streamOpenWaitTimeoutMs));
|
|
816
|
+
});
|
|
817
|
+
});
|
|
818
|
+
}
|
|
599
819
|
/**
|
|
600
820
|
* Connect to a WebTransport server (Node API).
|
|
601
821
|
*
|
|
@@ -618,9 +838,7 @@ class NativeClientSession {
|
|
|
618
838
|
* ```
|
|
619
839
|
*/
|
|
620
840
|
export async function connect(url, opts) {
|
|
621
|
-
|
|
622
|
-
throw new Error("Native addon not loaded");
|
|
623
|
-
}
|
|
841
|
+
const native = getNativeOrThrow();
|
|
624
842
|
if (opts?.tls?.insecureSkipVerify === true &&
|
|
625
843
|
(opts.log !== undefined || !shouldSuppressInsecureSkipVerifyWarning())) {
|
|
626
844
|
const log = opts.log ??
|
|
@@ -651,57 +869,11 @@ export async function connect(url, opts) {
|
|
|
651
869
|
requireUnreliable: opts?.requireUnreliable,
|
|
652
870
|
});
|
|
653
871
|
const handshakeTimeout = mergedLimits.handshakeTimeoutMs;
|
|
654
|
-
|
|
655
|
-
const closedResolvers = new Map();
|
|
656
|
-
const onClosed = (events) => {
|
|
657
|
-
for (const evt of events) {
|
|
658
|
-
if (evt.name === "session_closed" && evt.id != null) {
|
|
659
|
-
const resolveClosed = closedResolvers.get(evt.id);
|
|
660
|
-
closedResolvers.delete(evt.id);
|
|
661
|
-
if (resolveClosed)
|
|
662
|
-
resolveClosed({ code: evt.code, reason: evt.reason });
|
|
663
|
-
}
|
|
664
|
-
}
|
|
665
|
-
};
|
|
666
|
-
native.connect(url, optsJson, onClosed, (err, handleId) => {
|
|
667
|
-
if (err) {
|
|
668
|
-
reject(toWebTransportError(err, opts?.strictW3CErrors));
|
|
669
|
-
return;
|
|
670
|
-
}
|
|
671
|
-
if (handleId == null) {
|
|
672
|
-
reject(new Error("connect succeeded but no handle id"));
|
|
673
|
-
return;
|
|
674
|
-
}
|
|
675
|
-
const handle = native.takeClientSession(handleId);
|
|
676
|
-
if (!handle) {
|
|
677
|
-
reject(new Error("connect: handle not found in registry"));
|
|
678
|
-
return;
|
|
679
|
-
}
|
|
680
|
-
let closedResolve;
|
|
681
|
-
const closedPromise = new Promise((r) => {
|
|
682
|
-
closedResolve = r;
|
|
683
|
-
});
|
|
684
|
-
closedResolvers.set(handle.id, closedResolve);
|
|
685
|
-
const readyPromise = Promise.resolve();
|
|
686
|
-
resolve(new NativeClientSession(handle, readyPromise, closedPromise, opts?.strictW3CErrors));
|
|
687
|
-
});
|
|
688
|
-
});
|
|
689
|
-
const timeoutPromise = new Promise((_, reject) => {
|
|
690
|
-
setTimeout(() => {
|
|
691
|
-
const msg = `E_HANDSHAKE_TIMEOUT: connect timed out after ${handshakeTimeout}ms`;
|
|
692
|
-
const browserName = opts?.strictW3CErrors === true
|
|
693
|
-
? (normalizeToBrowserName(E_HANDSHAKE_TIMEOUT, msg) ??
|
|
694
|
-
undefined)
|
|
695
|
-
: undefined;
|
|
696
|
-
reject(new WebTransportError(E_HANDSHAKE_TIMEOUT, msg, browserName ? { browserName } : undefined));
|
|
697
|
-
}, handshakeTimeout);
|
|
698
|
-
});
|
|
699
|
-
return Promise.race([connectPromise, timeoutPromise]);
|
|
872
|
+
return connectWithNative(native, url, optsJson, handshakeTimeout, opts?.strictW3CErrors, mergedLimits.backpressureTimeoutMs);
|
|
700
873
|
}
|
|
701
874
|
/** Client pool metrics (hits, misses, evictions). For tests when allowPooling is used. */
|
|
702
875
|
export function clientPoolMetricsSnapshot() {
|
|
703
|
-
|
|
704
|
-
throw new Error("Native addon not loaded");
|
|
876
|
+
const native = getNativeOrThrow();
|
|
705
877
|
const s = native.clientPoolMetricsSnapshot();
|
|
706
878
|
return {
|
|
707
879
|
hits: s.hits,
|
|
@@ -1010,7 +1182,7 @@ export class WebTransport {
|
|
|
1010
1182
|
throw new WebTransportError(E_SESSION_CLOSED);
|
|
1011
1183
|
}
|
|
1012
1184
|
const s = await this.#sessionPromise;
|
|
1013
|
-
const duplex = await s.createBidirectionalStream();
|
|
1185
|
+
const duplex = await s.createBidirectionalStream(options);
|
|
1014
1186
|
return nodeDuplexToWebBidi(duplex, this.#sendScheduler, policy, (bytes) => {
|
|
1015
1187
|
this.#connStats.bytesSent += bytes;
|
|
1016
1188
|
this._recordSendGroupBytes(policy.groupId, bytes);
|
|
@@ -1030,7 +1202,7 @@ export class WebTransport {
|
|
|
1030
1202
|
throw new WebTransportError(E_SESSION_CLOSED);
|
|
1031
1203
|
}
|
|
1032
1204
|
const s = await this.#sessionPromise;
|
|
1033
|
-
const writable = await s.createUnidirectionalStream();
|
|
1205
|
+
const writable = await s.createUnidirectionalStream(options);
|
|
1034
1206
|
return nodeWritableToWebWritable(writable, this.#sendScheduler, policy, (bytes) => {
|
|
1035
1207
|
this.#connStats.bytesSent += bytes;
|
|
1036
1208
|
this._recordSendGroupBytes(policy.groupId, bytes);
|
|
@@ -1074,7 +1246,12 @@ export class WebTransport {
|
|
|
1074
1246
|
}
|
|
1075
1247
|
else {
|
|
1076
1248
|
// Still connecting: absorb eventual connect failure to prevent unhandled rejection (S4).
|
|
1077
|
-
this.#ready.catch(() => {
|
|
1249
|
+
this.#ready.catch((err) => {
|
|
1250
|
+
if (!SUPPRESS_READY_REJECTION_WARN) {
|
|
1251
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
1252
|
+
console.warn(`[webtransport] ready rejection observed after close() during connect: ${msg}`);
|
|
1253
|
+
}
|
|
1254
|
+
});
|
|
1078
1255
|
}
|
|
1079
1256
|
}
|
|
1080
1257
|
/** Internal: session for adapters (not part of spec) */
|
|
@@ -1221,8 +1398,11 @@ function createServerIncomingBidiStreams(nativeHandle, isClosed) {
|
|
|
1221
1398
|
});
|
|
1222
1399
|
controller.enqueue(attachServerBidiControls(duplex, await nodeDuplexToWebBidi(duplex)));
|
|
1223
1400
|
}
|
|
1224
|
-
catch {
|
|
1225
|
-
|
|
1401
|
+
catch (err) {
|
|
1402
|
+
if (isClosed() || isSessionCloseError(err))
|
|
1403
|
+
break;
|
|
1404
|
+
controller.error(toWebTransportError(err));
|
|
1405
|
+
return;
|
|
1226
1406
|
}
|
|
1227
1407
|
}
|
|
1228
1408
|
controller.close();
|
|
@@ -1243,8 +1423,11 @@ function createServerIncomingUniStreams(nativeHandle, isClosed) {
|
|
|
1243
1423
|
});
|
|
1244
1424
|
controller.enqueue(attachServerRecvControls(readable, nodeReadableToWebReadable(readable)));
|
|
1245
1425
|
}
|
|
1246
|
-
catch {
|
|
1247
|
-
|
|
1426
|
+
catch (err) {
|
|
1427
|
+
if (isClosed() || isSessionCloseError(err))
|
|
1428
|
+
break;
|
|
1429
|
+
controller.error(toWebTransportError(err));
|
|
1430
|
+
return;
|
|
1248
1431
|
}
|
|
1249
1432
|
}
|
|
1250
1433
|
controller.close();
|
|
@@ -1343,6 +1526,21 @@ function nodeWritableToWebWritable(w, scheduler, policy, onWriteBytes) {
|
|
|
1343
1526
|
},
|
|
1344
1527
|
});
|
|
1345
1528
|
}
|
|
1529
|
+
function createNativeClientSessionForTests(nativeHandle, strictW3CErrors = false) {
|
|
1530
|
+
return new NativeClientSession(nativeHandle, Promise.resolve(), new Promise(() => { }), strictW3CErrors);
|
|
1531
|
+
}
|
|
1532
|
+
function createNativeServerSessionForTests(nativeHandle) {
|
|
1533
|
+
return new NativeServerSession(nativeHandle, new Promise(() => { }), DEFAULT_LIMITS.backpressureTimeoutMs);
|
|
1534
|
+
}
|
|
1535
|
+
export const __TESTING__ = {
|
|
1536
|
+
createNativeClientSessionForTests,
|
|
1537
|
+
createNativeServerSessionForTests,
|
|
1538
|
+
createServerIncomingBidiStreamsForTests: createServerIncomingBidiStreams,
|
|
1539
|
+
createServerIncomingUniStreamsForTests: createServerIncomingUniStreams,
|
|
1540
|
+
tryLoadNativeAddonForTests: tryLoadNativeAddon,
|
|
1541
|
+
buildNativeAddonLoadErrorMessageForTests: buildNativeAddonLoadErrorMessage,
|
|
1542
|
+
connectWithNativeForTests: connectWithNative,
|
|
1543
|
+
};
|
|
1346
1544
|
/**
|
|
1347
1545
|
* Wrap an existing {@link ClientSession} as a browser-style WebTransport.
|
|
1348
1546
|
*
|
package/dist/streams.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ type StreamHandleId = number;
|
|
|
31
31
|
export interface BidiStreamOptions extends DuplexOptions {
|
|
32
32
|
handleId: StreamHandleId;
|
|
33
33
|
nativeHandle?: any;
|
|
34
|
+
strictStreamErrors?: boolean;
|
|
34
35
|
}
|
|
35
36
|
export declare class BidiStream extends Duplex implements Resettable, StopSendable {
|
|
36
37
|
#private;
|
|
@@ -46,6 +47,7 @@ export declare class BidiStream extends Duplex implements Resettable, StopSendab
|
|
|
46
47
|
export interface SendStreamOptions extends WritableOptions {
|
|
47
48
|
handleId: StreamHandleId;
|
|
48
49
|
nativeHandle?: any;
|
|
50
|
+
strictStreamErrors?: boolean;
|
|
49
51
|
}
|
|
50
52
|
export declare class SendStream extends Writable implements Resettable {
|
|
51
53
|
#private;
|
|
@@ -59,6 +61,7 @@ export declare class SendStream extends Writable implements Resettable {
|
|
|
59
61
|
export interface RecvStreamOptions extends ReadableOptions {
|
|
60
62
|
handleId: StreamHandleId;
|
|
61
63
|
nativeHandle?: any;
|
|
64
|
+
strictStreamErrors?: boolean;
|
|
62
65
|
}
|
|
63
66
|
export declare class RecvStream extends Readable implements StopSendable {
|
|
64
67
|
#private;
|
package/dist/streams.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streams.d.ts","sourceRoot":"","sources":["../src/streams.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,KAAK,EACX,aAAa,EACb,eAAe,EACf,eAAe,EACf,MAAM,aAAa,CAAC;AAErB;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,OAAO,MAA2B,CAAC;AAC1D;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,OAAO,MAAkC,CAAC;AAExE,+CAA+C;AAC/C,MAAM,MAAM,UAAU,GAAG;IAAE,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AAC7D,4DAA4D;AAC5D,MAAM,MAAM,YAAY,GAAG;IAAE,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AAKtE,KAAK,cAAc,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"streams.d.ts","sourceRoot":"","sources":["../src/streams.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,KAAK,EACX,aAAa,EACb,eAAe,EACf,eAAe,EACf,MAAM,aAAa,CAAC;AAErB;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,OAAO,MAA2B,CAAC;AAC1D;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,OAAO,MAAkC,CAAC;AAExE,+CAA+C;AAC/C,MAAM,MAAM,UAAU,GAAG;IAAE,CAA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)[WT_STOP_SENDING](code)`
|
|
19
19
|
*/
|
|
20
20
|
export const WT_STOP_SENDING = Symbol("WT_STOP_SENDING");
|
|
21
|
+
const DEFAULT_STRICT_STREAM_ERRORS = process.env.WEBTRANSPORT_STRICT_STREAM_ERRORS === "1";
|
|
22
|
+
const SUPPRESS_UNHANDLED_STREAM_ERROR_LOGS = process.env.WEBTRANSPORT_SUPPRESS_UNHANDLED_STREAM_ERROR_LOGS === "1";
|
|
23
|
+
function normalizeError(err) {
|
|
24
|
+
return err instanceof Error ? err : new Error(String(err));
|
|
25
|
+
}
|
|
21
26
|
export class BidiStream extends Duplex {
|
|
22
27
|
_handleId;
|
|
23
28
|
#nativeHandle;
|
|
24
29
|
#destroyed = false;
|
|
30
|
+
#strictStreamErrors = DEFAULT_STRICT_STREAM_ERRORS;
|
|
25
31
|
constructor(opts) {
|
|
26
32
|
super({
|
|
27
33
|
...opts,
|
|
@@ -32,6 +38,20 @@ export class BidiStream extends Duplex {
|
|
|
32
38
|
});
|
|
33
39
|
this._handleId = opts.handleId;
|
|
34
40
|
this.#nativeHandle = opts.nativeHandle;
|
|
41
|
+
this.#strictStreamErrors =
|
|
42
|
+
opts.strictStreamErrors ?? DEFAULT_STRICT_STREAM_ERRORS;
|
|
43
|
+
this.on("error", (err) => {
|
|
44
|
+
if (this.listenerCount("error") > 1)
|
|
45
|
+
return;
|
|
46
|
+
const e = normalizeError(err);
|
|
47
|
+
if (!SUPPRESS_UNHANDLED_STREAM_ERROR_LOGS) {
|
|
48
|
+
console.warn(`[webtransport] unhandled bidi stream error: ${e.message}`);
|
|
49
|
+
}
|
|
50
|
+
if (this.#strictStreamErrors)
|
|
51
|
+
queueMicrotask(() => {
|
|
52
|
+
throw e;
|
|
53
|
+
});
|
|
54
|
+
});
|
|
35
55
|
}
|
|
36
56
|
// -- Node stream overrides -----------------------
|
|
37
57
|
_read(_size) {
|
|
@@ -60,17 +80,39 @@ export class BidiStream extends Duplex {
|
|
|
60
80
|
.catch(callback);
|
|
61
81
|
}
|
|
62
82
|
_final(callback) {
|
|
63
|
-
this.#nativeHandle
|
|
64
|
-
|
|
83
|
+
const h = this.#nativeHandle;
|
|
84
|
+
if (!h || this.#destroyed) {
|
|
85
|
+
callback();
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
try {
|
|
89
|
+
const finishFn = h.finishWait ?? h.finish;
|
|
90
|
+
if (typeof finishFn !== "function") {
|
|
91
|
+
callback();
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
const ret = finishFn.call(h);
|
|
95
|
+
if (ret && typeof ret.then === "function") {
|
|
96
|
+
ret.then(() => callback(), (err) => callback(err));
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
callback();
|
|
100
|
+
}
|
|
101
|
+
catch (err) {
|
|
102
|
+
callback(err);
|
|
103
|
+
}
|
|
65
104
|
}
|
|
66
105
|
_destroy(error, callback) {
|
|
67
106
|
if (!this.#destroyed) {
|
|
68
107
|
this.#destroyed = true;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
108
|
+
if (error) {
|
|
109
|
+
try {
|
|
110
|
+
this.#nativeHandle?.reset?.(0);
|
|
111
|
+
}
|
|
112
|
+
catch (err) {
|
|
113
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
114
|
+
console.warn(`[webtransport] bidi stream reset on destroy failed: ${msg}`);
|
|
115
|
+
}
|
|
74
116
|
}
|
|
75
117
|
this.#nativeHandle = null;
|
|
76
118
|
}
|
|
@@ -89,6 +131,7 @@ export class SendStream extends Writable {
|
|
|
89
131
|
_handleId;
|
|
90
132
|
#nativeHandle;
|
|
91
133
|
#destroyed = false;
|
|
134
|
+
#strictStreamErrors = DEFAULT_STRICT_STREAM_ERRORS;
|
|
92
135
|
constructor(opts) {
|
|
93
136
|
super({
|
|
94
137
|
...opts,
|
|
@@ -97,6 +140,20 @@ export class SendStream extends Writable {
|
|
|
97
140
|
});
|
|
98
141
|
this._handleId = opts.handleId;
|
|
99
142
|
this.#nativeHandle = opts.nativeHandle;
|
|
143
|
+
this.#strictStreamErrors =
|
|
144
|
+
opts.strictStreamErrors ?? DEFAULT_STRICT_STREAM_ERRORS;
|
|
145
|
+
this.on("error", (err) => {
|
|
146
|
+
if (this.listenerCount("error") > 1)
|
|
147
|
+
return;
|
|
148
|
+
const e = normalizeError(err);
|
|
149
|
+
if (!SUPPRESS_UNHANDLED_STREAM_ERROR_LOGS) {
|
|
150
|
+
console.warn(`[webtransport] unhandled unidirectional send stream error: ${e.message}`);
|
|
151
|
+
}
|
|
152
|
+
if (this.#strictStreamErrors)
|
|
153
|
+
queueMicrotask(() => {
|
|
154
|
+
throw e;
|
|
155
|
+
});
|
|
156
|
+
});
|
|
100
157
|
}
|
|
101
158
|
_write(chunk, _encoding, callback) {
|
|
102
159
|
const h = this.#nativeHandle;
|
|
@@ -109,17 +166,39 @@ export class SendStream extends Writable {
|
|
|
109
166
|
.catch(callback);
|
|
110
167
|
}
|
|
111
168
|
_final(callback) {
|
|
112
|
-
this.#nativeHandle
|
|
113
|
-
|
|
169
|
+
const h = this.#nativeHandle;
|
|
170
|
+
if (!h || this.#destroyed) {
|
|
171
|
+
callback();
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
try {
|
|
175
|
+
const finishFn = h.finishWait ?? h.finish;
|
|
176
|
+
if (typeof finishFn !== "function") {
|
|
177
|
+
callback();
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
const ret = finishFn.call(h);
|
|
181
|
+
if (ret && typeof ret.then === "function") {
|
|
182
|
+
ret.then(() => callback(), (err) => callback(err));
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
callback();
|
|
186
|
+
}
|
|
187
|
+
catch (err) {
|
|
188
|
+
callback(err);
|
|
189
|
+
}
|
|
114
190
|
}
|
|
115
191
|
_destroy(error, callback) {
|
|
116
192
|
if (!this.#destroyed) {
|
|
117
193
|
this.#destroyed = true;
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
194
|
+
if (error) {
|
|
195
|
+
try {
|
|
196
|
+
this.#nativeHandle?.reset?.(0);
|
|
197
|
+
}
|
|
198
|
+
catch (err) {
|
|
199
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
200
|
+
console.warn(`[webtransport] unidirectional send stream reset on destroy failed: ${msg}`);
|
|
201
|
+
}
|
|
123
202
|
}
|
|
124
203
|
this.#nativeHandle = null;
|
|
125
204
|
}
|
|
@@ -134,6 +213,7 @@ export class RecvStream extends Readable {
|
|
|
134
213
|
_handleId;
|
|
135
214
|
#nativeHandle;
|
|
136
215
|
#destroyed = false;
|
|
216
|
+
#strictStreamErrors = DEFAULT_STRICT_STREAM_ERRORS;
|
|
137
217
|
constructor(opts) {
|
|
138
218
|
super({
|
|
139
219
|
...opts,
|
|
@@ -142,6 +222,20 @@ export class RecvStream extends Readable {
|
|
|
142
222
|
});
|
|
143
223
|
this._handleId = opts.handleId;
|
|
144
224
|
this.#nativeHandle = opts.nativeHandle;
|
|
225
|
+
this.#strictStreamErrors =
|
|
226
|
+
opts.strictStreamErrors ?? DEFAULT_STRICT_STREAM_ERRORS;
|
|
227
|
+
this.on("error", (err) => {
|
|
228
|
+
if (this.listenerCount("error") > 1)
|
|
229
|
+
return;
|
|
230
|
+
const e = normalizeError(err);
|
|
231
|
+
if (!SUPPRESS_UNHANDLED_STREAM_ERROR_LOGS) {
|
|
232
|
+
console.warn(`[webtransport] unhandled unidirectional recv stream error: ${e.message}`);
|
|
233
|
+
}
|
|
234
|
+
if (this.#strictStreamErrors)
|
|
235
|
+
queueMicrotask(() => {
|
|
236
|
+
throw e;
|
|
237
|
+
});
|
|
238
|
+
});
|
|
145
239
|
}
|
|
146
240
|
_read(_size) {
|
|
147
241
|
const h = this.#nativeHandle;
|
|
@@ -161,11 +255,14 @@ export class RecvStream extends Readable {
|
|
|
161
255
|
_destroy(error, callback) {
|
|
162
256
|
if (!this.#destroyed) {
|
|
163
257
|
this.#destroyed = true;
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
258
|
+
if (error) {
|
|
259
|
+
try {
|
|
260
|
+
this.#nativeHandle?.stopSending?.(0);
|
|
261
|
+
}
|
|
262
|
+
catch (err) {
|
|
263
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
264
|
+
console.warn(`[webtransport] unidirectional recv stream stopSending on destroy failed: ${msg}`);
|
|
265
|
+
}
|
|
169
266
|
}
|
|
170
267
|
this.#nativeHandle = null;
|
|
171
268
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webtransport-bun/webtransport",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "Production-focused WebTransport for Bun with datagrams and streams via a Rust napi-rs addon",
|
|
3
|
+
"version": "0.2.4",
|
|
4
|
+
"description": "Production-focused WebTransport for Bun, Node, and Deno with datagrams and streams via a Rust napi-rs addon",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
},
|
|
14
14
|
"keywords": [
|
|
15
15
|
"bun",
|
|
16
|
+
"node",
|
|
17
|
+
"deno",
|
|
16
18
|
"webtransport",
|
|
17
19
|
"quic",
|
|
18
20
|
"napi-rs",
|
|
@@ -34,7 +36,8 @@
|
|
|
34
36
|
"LICENSE"
|
|
35
37
|
],
|
|
36
38
|
"engines": {
|
|
37
|
-
"bun": ">=1.3.9"
|
|
39
|
+
"bun": ">=1.3.9",
|
|
40
|
+
"node": ">=18"
|
|
38
41
|
},
|
|
39
42
|
"os": [
|
|
40
43
|
"darwin",
|
package/prebuilds/SHA256SUMS
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
9f852722f88e7fc53405a2f73e114c32cd40c7e6da9e63583ea8f75586c930d0 webtransport-native.darwin-arm64.node
|
|
2
|
+
85b96ba76475693c5aa69342a313134554bcbdcb09c2e98729c38e22c4b57d98 webtransport-native.darwin-x64.node
|
|
3
|
+
6f073d900cf415bd1fe669ba345bc8982ae899e8ed7c4d986a3a3ad049a0f6a5 webtransport-native.linux-x64-gnu.node
|
|
Binary file
|
|
Binary file
|
|
Binary file
|