@fails-components/webtransport 1.0.11 → 1.1.0
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/lib/http2/node/client.d.ts.map +1 -1
- package/dist/lib/http2/node/server.d.ts +4 -4
- package/dist/lib/http2/node/server.d.ts.map +1 -1
- package/dist/lib/server.d.ts.map +1 -1
- package/dist/lib/session.d.ts +8 -4
- package/dist/lib/session.d.ts.map +1 -1
- package/dist/lib/types.d.ts +9 -4
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/lib/webtransport.browser.d.ts.map +1 -1
- package/dist/lib/webtransport.node.d.ts.map +1 -1
- package/lib/http2/node/client.js +5 -2
- package/lib/http2/node/server.js +64 -39
- package/lib/server.js +7 -4
- package/lib/session.js +5 -2
- package/lib/types.ts +9 -4
- package/lib/webtransport.browser.js +3 -2
- package/lib/webtransport.node.js +7 -5
- package/package.json +1 -1
- package/test/fixtures/read-stream.js +20 -7
- package/test/fixtures/reader-value.js +0 -5
- package/test/fixtures/server.js +46 -0
- package/test/session.spec.js +16 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../lib/http2/node/client.js"],"names":[],"mappings":";AAOA;IACE;;OAEG;IACH,kBAFW,OAAO,gBAAgB,EAAE,mBAAmB,EAiCtD;IA5BC,aAAwB;IACxB,iBAAyC;IACzC,mEAAyE;IACzE,8BAAqD;IACrD,sBAA+C;IAC/C,mBAAyC;IACzC,uCACmD;IACnD,wCACoD;IAEpD,oCAC8C;IAC9C,qCAC+C;IAE/C,2CACiD;IACjD,yCAC2D;IAE3D,4CACkD;IAClD,0CAC6D;IAC7D,oDAAoD;IAEpD,OAFW,OAAO,kBAAkB,EAAE,UAAU,CAE1B;IAGxB,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../lib/http2/node/client.js"],"names":[],"mappings":";AAOA;IACE;;OAEG;IACH,kBAFW,OAAO,gBAAgB,EAAE,mBAAmB,EAiCtD;IA5BC,aAAwB;IACxB,iBAAyC;IACzC,mEAAyE;IACzE,8BAAqD;IACrD,sBAA+C;IAC/C,mBAAyC;IACzC,uCACmD;IACnD,wCACoD;IAEpD,oCAC8C;IAC9C,qCAC+C;IAE/C,2CACiD;IACjD,yCAC2D;IAE3D,4CACkD;IAClD,0CAC6D;IAC7D,oDAAoD;IAEpD,OAFW,OAAO,kBAAkB,EAAE,UAAU,CAE1B;IAGxB,wBA4JC;IA9FC,0DAGC;IA6FH;;OAEG;IACH,oBAFW,MAAM,QA4DhB;IAED,oBAEC;CACF"}
|
|
@@ -30,11 +30,11 @@ export class Http2WebTransportServer {
|
|
|
30
30
|
startServer(): void;
|
|
31
31
|
stopServer(): void;
|
|
32
32
|
/**
|
|
33
|
-
* @param {string} cert
|
|
34
|
-
* @param {string} privKey
|
|
33
|
+
* @param {string|string[]} cert
|
|
34
|
+
* @param {string|string[]} privKey
|
|
35
35
|
* @param {boolean} http2only
|
|
36
36
|
* */
|
|
37
|
-
updateCert(cert: string, privKey: string, http2only: boolean): void;
|
|
37
|
+
updateCert(cert: string | string[], privKey: string | string[], http2only: boolean): void;
|
|
38
38
|
/**
|
|
39
39
|
* @param {boolean} isset
|
|
40
40
|
*/
|
|
@@ -54,7 +54,7 @@ export class Http2WebTransportServer {
|
|
|
54
54
|
/**
|
|
55
55
|
* @param {import('../../types.js').NativeFinishSessionRequest} args
|
|
56
56
|
*/
|
|
57
|
-
finishSessionRequest({ header, session: stream, status, protocol, head }: import('../../types.js').NativeFinishSessionRequest): void;
|
|
57
|
+
finishSessionRequest({ header, userData, session: stream, status, protocol, head, path, transportPrivate }: import('../../types.js').NativeFinishSessionRequest): void;
|
|
58
58
|
}
|
|
59
59
|
import { WebSocketParser } from "./websocketparser.js";
|
|
60
60
|
//# sourceMappingURL=server.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../../lib/http2/node/server.js"],"names":[],"mappings":";AASA;IACE;;OAEG;IACH,kBAFW,OAAO,gBAAgB,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../../lib/http2/node/server.js"],"names":[],"mappings":";AASA;IACE;;OAEG;IACH,kBAFW,OAAO,gBAAgB,EAAE,mBAAmB,EAkVtD;IA7UC,aAAwB;IACxB,eAA0B;IAE1B,aAAqC;IAMrC,uCACmD;IACnD,wCACoD;IAEpD,oCAA2E;IAC3E,qCAC2C;IAE3C,2CACiD;IACjD,yCAC2D;IAE3D,4CACkD;IAClD,0CAC6D;IAE7D,sCAAsC;IACtC,OADW,OAAO,MAAM,EAAE,OAAO,CAAC,CACnB;IACf,2BAA8B;IAC9B,oDAAoD;IAEpD,OAFW,OAAO,kBAAkB,EAAE,UAAU,CAE1B;IAEtB,2BAA8B;IAG9B,6CAgBE;IA6F6B,4BAYb;IAgLpB;;OAEG;IACH,4BAFW,OAAO,OAAO,EAAE,mBAAmB,OAgB7C;IAED,oBAEC;IAED,mBAGC;IAED;;;;SAIK;IACL,iBAJW,MAAM,GAAC,MAAM,EAAE,WACf,MAAM,GAAC,MAAM,EAAE,aACf,OAAO,QAIjB;IAED;;OAEG;IACH,2BAFW,OAAO,QAIjB;IAED;;OAEG;IACH,cAFW,MAAM,QAIhB;IAED;;OAEG;IACH,+CAFW;QAAC,MAAM,EAAE,OAAO,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,GAAG,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAC,iBA4BvE;IAED;;OAEG;IACH,4GAFW,OAAO,gBAAgB,EAAE,0BAA0B,QAwK7D;CACF"}
|
package/dist/lib/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../lib/server.js"],"names":[],"mappings":";AAuHA;;GAEG;AACH;IACE;;;OAGG;IACH,kBAFW,cAAc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AM,EAAE,CAEK;IAEvB;;OAEG;IACH,yBAFU,SAAS,GAAC,OAAO,CAEa;IAG1C,oBAgBC;IAED,mBAOC;IADC,6BAAmB;IAGrB;;;;SAIK;IACL,iBAJW,MAAM,WACN,MAAM,aACN,OAAO,QAKjB;IAED;;OAEG;IACH,WAFa;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,IAAI,CAY1E;IAED;;OAEG;IACH,6BAFW,GAAG,QAQb;IAED;;;;;OAKG;IACH,oBALW,MAAM;;oBAGJ,eAAe,mBAAmB,CAAC,CAgB/C;IAED;;OAEG;IACH,uBAFW,yBAAyB,QAsBnC;IAED;;OAEG;IACH,6BAFW,+BAA+B,QAazC;IAED;;OAEG;IACH,+CAEC;IAED;;OAEG;IACH,uBAFW,wBAAwB,QAMlC;IAED;OACG;IACH,sBAEC;IAED;;QAEI;IACJ,0BAFU;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,GAAE,SAAS,iBAsElC;IA1CO,kBAA0D;CA2CnE;AAED;CAQC;AAED;CAQC;kCAzVY,OAAO,SAAS,EAAE,uBAAuB;kCACzC,OAAO,SAAS,EAAE,mBAAmB;qCACrC,OAAO,SAAS,EAAE,sBAAsB;8CACxC,OAAO,SAAS,EAAE,+BAA+B;uCACjD,OAAO,SAAS,EAAE,wBAAwB;wCAC1C,OAAO,SAAS,EAAE,yBAAyB;6BAC3C,OAAO,SAAS,EAAE,cAAc"}
|
package/dist/lib/session.d.ts
CHANGED
|
@@ -41,12 +41,14 @@ export class HttpWTSession implements WebTransportSessionEventHandler, WebTransp
|
|
|
41
41
|
* @param {object} args
|
|
42
42
|
* @param {import('./types').NativeHttpWTSession} [args.object]
|
|
43
43
|
* @param {HttpServer | HttpClient} args.parentobj
|
|
44
|
-
* @param {
|
|
44
|
+
* @param {Object | undefined} [args.header= undefined]
|
|
45
|
+
* @param {Object | undefined} [args.userData= undefined]
|
|
45
46
|
*/
|
|
46
47
|
constructor(args: {
|
|
47
48
|
object?: import("./types").NativeHttpWTSession | undefined;
|
|
48
49
|
parentobj: HttpServer | HttpClient;
|
|
49
|
-
header?:
|
|
50
|
+
header?: Object | undefined;
|
|
51
|
+
userData?: Object | undefined;
|
|
50
52
|
});
|
|
51
53
|
objint: import("./types").NativeHttpWTSession | undefined;
|
|
52
54
|
parentobj: import("./client").HttpClient | import("./server").HttpServer;
|
|
@@ -56,8 +58,10 @@ export class HttpWTSession implements WebTransportSessionEventHandler, WebTransp
|
|
|
56
58
|
readyResolve: ((value?: any) => void) | null | undefined;
|
|
57
59
|
/** @type {(() => void) | null | undefined} */
|
|
58
60
|
closeHook: (() => void) | null | undefined;
|
|
59
|
-
/** @type {(
|
|
60
|
-
header: (
|
|
61
|
+
/** @type {(Object | null | undefined)} */
|
|
62
|
+
header: (Object | null | undefined);
|
|
63
|
+
/** @type {(Object | null | undefined)} */
|
|
64
|
+
userData: (Object | null | undefined);
|
|
61
65
|
/** @type {Promise<void>} */
|
|
62
66
|
ready: Promise<void>;
|
|
63
67
|
readyReject: (reason?: any) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../lib/session.js"],"names":[],"mappings":";AASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH;;;GAGG;AACH;IACE
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../lib/session.js"],"names":[],"mappings":";AASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH;;;GAGG;AACH;IACE;;;;;;OAMG;IACH;QALwD,MAAM;QACrB,SAAS,EAAvC,UAAU,GAAG,UAAU;QACG,MAAM,GAAhC,MAAM,GAAG,SAAS;QACQ,QAAQ,GAAlC,MAAM,GAAG,SAAS;OA6I5B;IAzIG,0DAAyB;IAM3B,yEAA+B;IAC/B,yDAAyD;IACz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B;IAED;;OAEG;IACH,qBAFW,iBAAiB,QAW3B;IAED;;OAEG;IACH,uBAFW,mBAAmB,QAK7B;CACF;;;;8CAvlBY,OAAO,SAAS,EAAE,+BAA+B;;;;gCACjD,OAAO,SAAS,EAAE,iBAAiB;;;;gCACnC,OAAO,SAAS,EAAE,iBAAiB;;;;oCACnC,OAAO,SAAS,EAAE,qBAAqB;;;;gCACvC,OAAO,SAAS,EAAE,iBAAiB;;;;kCACnC,OAAO,SAAS,EAAE,mBAAmB;;;;iCACrC,OAAO,SAAS,EAAE,kBAAkB;;;;gCACpC,OAAO,SAAS,EAAE,iBAAiB;;;;6BACnC,OAAO,SAAS,EAAE,cAAc;;;;oCAEhC,OAAO,OAAO,EAAE,qBAAqB;;;;8CACrC,OAAO,OAAO,EAAE,+BAA+B;;;;qCAC/C,OAAO,OAAO,EAAE,sBAAsB;;;;4CACtC,OAAO,OAAO,EAAE,6BAA6B;;;;wCAC7C,OAAO,OAAO,EAAE,yBAAyB;;;;+CACzC,OAAO,OAAO,EAAE,gCAAgC;;;;0CAChD,OAAO,OAAO,EAAE,2BAA2B;;;;4CAC3C,OAAO,OAAO,EAAE,6BAA6B;;;;gCAC7C,OAAO,OAAO,EAAE,iBAAiB;;;;wCACjC,OAAO,OAAO,EAAE,yBAAyB;;;;kCAEzC,OAAO,SAAS,EAAE,mBAAmB;;;;kCAGrC,OAAO,SAAS,EAAE,uBAAuB;;;;yBAEzC,OAAO,UAAU,EAAE,UAAU;;;;yBAC7B,OAAO,UAAU,EAAE,UAAU;;;;8CAE7B,OAAO,YAAY,EAAE,+BAA+B"}
|
package/dist/lib/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
/// <reference types="node" />
|
|
3
3
|
import type { WebTransportSession, WebTransportHash, WebTransportOptions, WebTransportSendGroup } from './dom';
|
|
4
|
-
import type { IncomingHttpHeaders, Http2Stream } from 'http2';
|
|
4
|
+
import type { IncomingHttpHeaders, Http2Stream, ServerHttp2Stream } from 'http2';
|
|
5
5
|
import { ParserBase } from './http2/parserbase';
|
|
6
6
|
import { Http2WebTransportSession } from './http2/session';
|
|
7
7
|
import { HttpClient } from './client';
|
|
@@ -106,11 +106,14 @@ export interface ReadBuffer {
|
|
|
106
106
|
fin: boolean;
|
|
107
107
|
}
|
|
108
108
|
export interface NativeFinishSessionRequest {
|
|
109
|
+
path: string;
|
|
109
110
|
header: IncomingHttpHeaders;
|
|
110
|
-
session:
|
|
111
|
+
session: ServerHttp2Stream;
|
|
111
112
|
status: number;
|
|
112
113
|
protocol: 'capsule' | 'websocket' | 'websocketoverhttp1' | 'http3';
|
|
113
114
|
head?: Buffer;
|
|
115
|
+
userData?: object;
|
|
116
|
+
transportPrivate?: object;
|
|
114
117
|
}
|
|
115
118
|
export type Purpose = 'StreamRecvSignal' | 'StreamRead' | 'StreamWrite' | 'StreamReset' | 'StreamNetworkFinish';
|
|
116
119
|
export type NetTask = 'stopSending' | 'resetStream' | 'streamFinal';
|
|
@@ -197,6 +200,7 @@ export interface HttpClientEventHandler {
|
|
|
197
200
|
export interface HttpWTServerSessionVisitorEvent extends HttpWTSessionVisitorEvent {
|
|
198
201
|
path: string;
|
|
199
202
|
header: Object;
|
|
203
|
+
userData?: Object | undefined;
|
|
200
204
|
}
|
|
201
205
|
export interface ServerSessionRequestEvent {
|
|
202
206
|
header: Object;
|
|
@@ -205,6 +209,7 @@ export interface ServerSessionRequestEvent {
|
|
|
205
209
|
session: any;
|
|
206
210
|
object?: any;
|
|
207
211
|
protocol: string;
|
|
212
|
+
transportPrivate?: Object;
|
|
208
213
|
}
|
|
209
214
|
/**
|
|
210
215
|
* The Http server is listening on the specified port
|
|
@@ -249,8 +254,8 @@ export interface HttpServerInit extends HttpWebTransportInit {
|
|
|
249
254
|
port: string | number;
|
|
250
255
|
host: string;
|
|
251
256
|
secret: string;
|
|
252
|
-
cert: string;
|
|
253
|
-
privKey: string;
|
|
257
|
+
cert: string | string[];
|
|
258
|
+
privKey: string | string[];
|
|
254
259
|
maxConnections?: number;
|
|
255
260
|
initialStreamFlowControlWindow?: number;
|
|
256
261
|
streamShouldAutoTuneReceiveWindow?: boolean;
|
package/dist/lib/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../lib/types.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,OAAO,CAAA;AACd,OAAO,KAAK,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../lib/types.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,OAAO,CAAA;AACd,OAAO,KAAK,EAAE,mBAAmB,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAChF,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAErC;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,+BAA+B,CAAA;IACtC,qBAAqB,CAAC,EAAE,MAAM,IAAI,CAAA;IAClC,aAAa,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAA;IAC1C,gBAAgB,EAAE,CAAC,IAAI,EAAC;QAAC,SAAS,EAAG,qBAAqB,GAAC,IAAI,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,kBAAkB,EAAE,OAAO,CAAA;KAAC,KAAK,OAAO,CAAA;IAC5H,eAAe,EAAE,CAAC,IAAI,EAAC;QAAC,SAAS,EAAG,qBAA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ACb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webtransport.browser.d.ts","sourceRoot":"","sources":["../../lib/webtransport.browser.js"],"names":[],"mappings":"AAqDA;;;;GAIG;AACH;
|
|
1
|
+
{"version":3,"file":"webtransport.browser.d.ts","sourceRoot":"","sources":["../../lib/webtransport.browser.js"],"names":[],"mappings":"AAqDA;;;;GAIG;AACH;IAyBI,4BAA0B;CAc7B;AAED;IACE;;;OAGG;IACH,iBAHW,MAAM,0DAsLhB;IAlLC,gBAAuB;IACvB,kBAAqB;IACrB,uBAAyB;IACzB,2BAA8B;IAC9B,sDAAgB;IAEhB,qBAGE;IAFA,+BAAuB;IACvB,iCAAsB;IAGxB,oBAGE;IAFA,+BAAuB;IACvB,iCAAsB;IAGxB,uBAGE;IAFA,kCAA0B;IAC1B,oCAAyB;IAMzB,cAeW,YAAY,GAAC,oBAAoB,CAfW;IAoFzD,+DAA+D;IAE/D,WAFW,OAAO,OAAO,EAAE,gCAAgC,CAExC;IAMf,yDAAuE;IAgBvE,yDAAuE;IAa3E,6DAeE;IAZE,iHAC4D;IAahE,8DAeE;IAZE,4GAC6D;IAcnE,uEAGC;IAED,+DAGC;IAED,oCAEC;IAED,yBAGC;IAED;;OAEG;IACH,2EAGC;IAED;;;OAGG;IACH,6FAFa,QAAQ,+BAA+B,CAAC,CAKpD;IAED;;;OAGG;IACH,8FAFa,QAAQ,sBAAsB,CAAC,CAK3C;CACF;2BAhUY,OAAO,OAAO,EAAE,YAAY;oCAC5B,OAAO,OAAO,EAAE,qBAAqB;8CACrC,OAAO,OAAO,EAAE,+BAA+B;qCAC/C,OAAO,OAAO,EAAE,sBAAsB;4CACtC,OAAO,OAAO,EAAE,6BAA6B;wCAC7C,OAAO,OAAO,EAAE,yBAAyB;gCACzC,OAAO,SAAS,EAAE,iBAAiB;;;;gCAKnC,OAAO,iBAAiB,EAAE,cAAc,CAAC,CAAC,CAAC;oCAkC3C,OAAO,OAAO,EAAE,YAAY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webtransport.node.d.ts","sourceRoot":"","sources":["../../lib/webtransport.node.js"],"names":[],"mappings":"AA0BA,wCA4BE;AAEF;;;;GAIG;AAEH;;;GAGG;AAEH;;;;GAIG;AACH;
|
|
1
|
+
{"version":3,"file":"webtransport.node.d.ts","sourceRoot":"","sources":["../../lib/webtransport.node.js"],"names":[],"mappings":"AA0BA,wCA4BE;AAEF;;;;GAIG;AAEH;;;GAGG;AAEH;;;;GAIG;AACH;CA2EC;oCA1FY,OAAO,OAAO,EAAE,qBAAqB;8CACrC,OAAO,OAAO,EAAE,+BAA+B;wCAC/C,OAAO,OAAO,EAAE,yBAAyB;;;;gCAKzC,OAAO,iBAAiB,EAAE,cAAc,CAAC,CAAC,CAAC;oCAI3C,OAAO,OAAO,EAAE,YAAY"}
|
package/lib/http2/node/client.js
CHANGED
|
@@ -44,9 +44,10 @@ export class Http2WebTransportClient {
|
|
|
44
44
|
|
|
45
45
|
createTransport() {
|
|
46
46
|
/**
|
|
47
|
+
* @param {string} hostname
|
|
47
48
|
* @param {import('node:tls').PeerCertificate} cert
|
|
48
49
|
* */
|
|
49
|
-
const webTransportVerifier = (cert) => {
|
|
50
|
+
const webTransportVerifier = (hostname, cert) => {
|
|
50
51
|
if (
|
|
51
52
|
this.serverCertificateHashes &&
|
|
52
53
|
this.serverCertificateHashes.some((el) => {
|
|
@@ -142,7 +143,9 @@ export class Http2WebTransportClient {
|
|
|
142
143
|
if (!oursocket.authorized) {
|
|
143
144
|
// ok last hope we have hashes
|
|
144
145
|
if (this.serverCertificateHashes) {
|
|
145
|
-
if (
|
|
146
|
+
if (
|
|
147
|
+
!webTransportVerifier(this.hostname, oursocket.getPeerCertificate())
|
|
148
|
+
) {
|
|
146
149
|
this.clientInt?.destroy(
|
|
147
150
|
undefined,
|
|
148
151
|
http2constants.NGHTTP2_REFUSED_STREAM
|
package/lib/http2/node/server.js
CHANGED
|
@@ -127,20 +127,31 @@ export class Http2WebTransportServer {
|
|
|
127
127
|
'upgrade',
|
|
128
128
|
(request, stream /* actually a socket */, head) => {
|
|
129
129
|
let path = request.url
|
|
130
|
-
const header = request.headers
|
|
131
130
|
if (!path) {
|
|
132
131
|
stream.destroy()
|
|
133
132
|
return
|
|
134
133
|
}
|
|
134
|
+
while (path.length > 1 && path[0] === '/' && path[1] === '/') {
|
|
135
|
+
path = path?.slice(1)
|
|
136
|
+
}
|
|
137
|
+
const header = { ...request.headers, ':path': path }
|
|
135
138
|
const websocketProt = this.checkProtocolHeader(header)
|
|
136
139
|
if (!websocketProt) {
|
|
137
140
|
stream.destroy()
|
|
138
141
|
return
|
|
139
142
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
143
|
+
if (this.hasrequesthandler) {
|
|
144
|
+
stream.head = head
|
|
145
|
+
|
|
146
|
+
const retObj = {
|
|
147
|
+
header,
|
|
148
|
+
session: stream,
|
|
149
|
+
protocol: 'websocketoverhttp1',
|
|
150
|
+
head,
|
|
151
|
+
transportPrivate: { websocketProt }
|
|
152
|
+
}
|
|
153
|
+
this.jsobj.onSessionRequest(retObj)
|
|
154
|
+
} else if (this.paths[path]) {
|
|
144
155
|
this.sendHttp1Headers({ stream, header, protocol: websocketProt })
|
|
145
156
|
.then(() => {
|
|
146
157
|
const retObj = {
|
|
@@ -189,16 +200,6 @@ export class Http2WebTransportServer {
|
|
|
189
200
|
log('Problem sendHttp1Header', error)
|
|
190
201
|
stream.destroy()
|
|
191
202
|
})
|
|
192
|
-
} else if (this.hasrequesthandler) {
|
|
193
|
-
stream.head = head
|
|
194
|
-
|
|
195
|
-
const retObj = {
|
|
196
|
-
header,
|
|
197
|
-
session: stream,
|
|
198
|
-
protocol: 'websocketoverhttp1',
|
|
199
|
-
head
|
|
200
|
-
}
|
|
201
|
-
this.jsobj.onSessionRequest(retObj)
|
|
202
203
|
} else {
|
|
203
204
|
stream.destroy()
|
|
204
205
|
}
|
|
@@ -245,7 +246,16 @@ export class Http2WebTransportServer {
|
|
|
245
246
|
while (path.length > 1 && path[0] === '/' && path[1] === '/') {
|
|
246
247
|
path = path?.slice(1)
|
|
247
248
|
}
|
|
248
|
-
|
|
249
|
+
header[':path'] = path // also adapt it for the middleware
|
|
250
|
+
if (this.hasrequesthandler) {
|
|
251
|
+
const retObj = {
|
|
252
|
+
header,
|
|
253
|
+
session: stream,
|
|
254
|
+
protocol: websocketProt ? 'websocket' : 'capsule',
|
|
255
|
+
transportPrivate: { websocketProt }
|
|
256
|
+
}
|
|
257
|
+
this.jsobj.onSessionRequest(retObj)
|
|
258
|
+
} else if (this.paths[path]) {
|
|
249
259
|
const {
|
|
250
260
|
0x2b65: remoteBidirectionalStreams = undefined,
|
|
251
261
|
0x2b64: remoteUnidirectionalStreams = undefined,
|
|
@@ -327,19 +337,6 @@ export class Http2WebTransportServer {
|
|
|
327
337
|
if (websocketProt) resp['sec-websocket-protocol'] = websocketProt
|
|
328
338
|
stream.respond(resp)
|
|
329
339
|
this.jsobj.onHttpWTSessionVisitor(retObj)
|
|
330
|
-
} else if (this.hasrequesthandler) {
|
|
331
|
-
const retObj = {
|
|
332
|
-
header,
|
|
333
|
-
session: stream,
|
|
334
|
-
protocol: websocketProt ? 'websocket' : 'capsule'
|
|
335
|
-
}
|
|
336
|
-
const resp = {
|
|
337
|
-
':status': '200'
|
|
338
|
-
}
|
|
339
|
-
// @ts-ignore
|
|
340
|
-
if (websocketProt) resp['sec-websocket-protocol'] = websocketProt
|
|
341
|
-
stream.respond(resp)
|
|
342
|
-
this.jsobj.onSessionRequest(retObj)
|
|
343
340
|
} else {
|
|
344
341
|
stream.respond({
|
|
345
342
|
':status': '404'
|
|
@@ -381,8 +378,8 @@ export class Http2WebTransportServer {
|
|
|
381
378
|
}
|
|
382
379
|
|
|
383
380
|
/**
|
|
384
|
-
* @param {string} cert
|
|
385
|
-
* @param {string} privKey
|
|
381
|
+
* @param {string|string[]} cert
|
|
382
|
+
* @param {string|string[]} privKey
|
|
386
383
|
* @param {boolean} http2only
|
|
387
384
|
* */
|
|
388
385
|
updateCert(cert, privKey, http2only) {
|
|
@@ -437,17 +434,35 @@ export class Http2WebTransportServer {
|
|
|
437
434
|
/**
|
|
438
435
|
* @param {import('../../types.js').NativeFinishSessionRequest} args
|
|
439
436
|
*/
|
|
440
|
-
finishSessionRequest({
|
|
437
|
+
finishSessionRequest({
|
|
438
|
+
header,
|
|
439
|
+
userData,
|
|
440
|
+
session: stream,
|
|
441
|
+
status,
|
|
442
|
+
protocol,
|
|
443
|
+
head,
|
|
444
|
+
path,
|
|
445
|
+
transportPrivate
|
|
446
|
+
}) {
|
|
441
447
|
if (status !== 200) {
|
|
442
448
|
if (protocol === 'websocketoverhttp1') {
|
|
443
449
|
stream.destroy()
|
|
444
450
|
} else {
|
|
445
|
-
stream.
|
|
451
|
+
stream.respond({
|
|
452
|
+
':status': status.toString()
|
|
453
|
+
})
|
|
454
|
+
stream.end()
|
|
455
|
+
stream.close()
|
|
446
456
|
}
|
|
447
457
|
} else {
|
|
448
458
|
if (protocol === 'websocketoverhttp1') {
|
|
449
|
-
|
|
450
|
-
|
|
459
|
+
this.sendHttp1Headers({
|
|
460
|
+
// @ts-ignore
|
|
461
|
+
stream,
|
|
462
|
+
header,
|
|
463
|
+
// @ts-ignore
|
|
464
|
+
protocol: transportPrivate.websocketProt
|
|
465
|
+
})
|
|
451
466
|
.then(() => {
|
|
452
467
|
const retObj = {
|
|
453
468
|
session: new Http2WebTransportSession({
|
|
@@ -484,8 +499,9 @@ export class Http2WebTransportServer {
|
|
|
484
499
|
this.sessionShouldAutoTuneReceiveWindow,
|
|
485
500
|
receiveWindowSizeLimit: this.sessionFlowControlWindowSizeLimit
|
|
486
501
|
}),
|
|
487
|
-
path
|
|
488
|
-
header
|
|
502
|
+
path,
|
|
503
|
+
header,
|
|
504
|
+
userData
|
|
489
505
|
}
|
|
490
506
|
// @ts-ignore
|
|
491
507
|
this.jsobj.onHttpWTSessionVisitor(retObj)
|
|
@@ -494,6 +510,14 @@ export class Http2WebTransportServer {
|
|
|
494
510
|
log('sendHttp1Headers error', error)
|
|
495
511
|
})
|
|
496
512
|
} else {
|
|
513
|
+
const resp = {
|
|
514
|
+
':status': '200'
|
|
515
|
+
}
|
|
516
|
+
// @ts-ignore
|
|
517
|
+
if (transportPrivate?.websocketProt)
|
|
518
|
+
// @ts-ignore
|
|
519
|
+
resp['sec-websocket-protocol'] = transportPrivate.websocketProt
|
|
520
|
+
stream.respond(resp)
|
|
497
521
|
const {
|
|
498
522
|
0x2b65: remoteBidirectionalStreams = undefined,
|
|
499
523
|
0x2b64: remoteUnidirectionalStreams = undefined,
|
|
@@ -566,8 +590,9 @@ export class Http2WebTransportServer {
|
|
|
566
590
|
this.sessionShouldAutoTuneReceiveWindow,
|
|
567
591
|
receiveWindowSizeLimit: this.sessionFlowControlWindowSizeLimit
|
|
568
592
|
}),
|
|
569
|
-
path
|
|
570
|
-
header
|
|
593
|
+
path,
|
|
594
|
+
header,
|
|
595
|
+
userData
|
|
571
596
|
}
|
|
572
597
|
// @ts-ignore
|
|
573
598
|
this.jsobj.onHttpWTSessionVisitor(retObj)
|
package/lib/server.js
CHANGED
|
@@ -82,8 +82,8 @@ class TransportIntServerProxy {
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
|
-
* @param {string} cert
|
|
86
|
-
* @param {string} privKey
|
|
85
|
+
* @param {string|string[]} cert
|
|
86
|
+
* @param {string|string[]} privKey
|
|
87
87
|
* @param {boolean} http2only
|
|
88
88
|
* */
|
|
89
89
|
updateCert(cert, privKey, http2only) {
|
|
@@ -245,16 +245,18 @@ export class HttpServer {
|
|
|
245
245
|
* @param {ServerSessionRequestEvent} args
|
|
246
246
|
*/
|
|
247
247
|
onSessionRequest(args) {
|
|
248
|
-
if (args.promise && args.header) {
|
|
248
|
+
if ((args.promise || args.protocol !== 'http3:libquiche') && args.header) {
|
|
249
249
|
if (!this.requestHandler) throw new Error('Request handler not set')
|
|
250
250
|
this.requestHandler({ header: args.header })
|
|
251
251
|
.then((/** @type {any} */ result) => {
|
|
252
252
|
log('oSR', result)
|
|
253
|
-
|
|
253
|
+
this.transportInt.finishSessionRequest({
|
|
254
254
|
promise: args.promise,
|
|
255
255
|
header: args.header,
|
|
256
256
|
session: args.session,
|
|
257
257
|
head: args.head,
|
|
258
|
+
transportPrivate: args.transportPrivate,
|
|
259
|
+
protocol: args.protocol,
|
|
258
260
|
...result
|
|
259
261
|
})
|
|
260
262
|
})
|
|
@@ -272,6 +274,7 @@ export class HttpServer {
|
|
|
272
274
|
const sesobj = new HttpWTSession({
|
|
273
275
|
object: args.session,
|
|
274
276
|
header: args.header,
|
|
277
|
+
userData: args.userData ?? {},
|
|
275
278
|
parentobj: this
|
|
276
279
|
})
|
|
277
280
|
args.session.jsobj = sesobj
|
package/lib/session.js
CHANGED
|
@@ -50,7 +50,8 @@ export class HttpWTSession {
|
|
|
50
50
|
* @param {object} args
|
|
51
51
|
* @param {import('./types').NativeHttpWTSession} [args.object]
|
|
52
52
|
* @param {HttpServer | HttpClient} args.parentobj
|
|
53
|
-
* @param {
|
|
53
|
+
* @param {Object | undefined} [args.header= undefined]
|
|
54
|
+
* @param {Object | undefined} [args.userData= undefined]
|
|
54
55
|
*/
|
|
55
56
|
constructor(args) {
|
|
56
57
|
if (args.object) {
|
|
@@ -68,8 +69,10 @@ export class HttpWTSession {
|
|
|
68
69
|
this.readyResolve = null
|
|
69
70
|
/** @type {(() => void) | null | undefined} */
|
|
70
71
|
this.closeHook = null
|
|
71
|
-
/** @type {(
|
|
72
|
+
/** @type {(Object | null | undefined)} */
|
|
72
73
|
this.header = args.header
|
|
74
|
+
/** @type {(Object | null | undefined)} */
|
|
75
|
+
this.userData = args.userData
|
|
73
76
|
|
|
74
77
|
/** @type {Promise<void>} */
|
|
75
78
|
this.ready = new Promise((resolve, reject) => {
|
package/lib/types.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type {
|
|
|
4
4
|
WebTransportOptions,
|
|
5
5
|
WebTransportSendGroup
|
|
6
6
|
} from './dom'
|
|
7
|
-
import type { IncomingHttpHeaders, Http2Stream } from 'http2'
|
|
7
|
+
import type { IncomingHttpHeaders, Http2Stream, ServerHttp2Stream } from 'http2'
|
|
8
8
|
import { ParserBase } from './http2/parserbase'
|
|
9
9
|
import { Http2WebTransportSession } from './http2/session'
|
|
10
10
|
import { HttpClient } from './client'
|
|
@@ -103,11 +103,14 @@ export interface ReadBuffer {
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
export interface NativeFinishSessionRequest {
|
|
106
|
+
path: string
|
|
106
107
|
header: IncomingHttpHeaders
|
|
107
|
-
session:
|
|
108
|
+
session: ServerHttp2Stream
|
|
108
109
|
status: number
|
|
109
110
|
protocol: 'capsule' | 'websocket' | 'websocketoverhttp1' | 'http3'
|
|
110
111
|
head?: Buffer
|
|
112
|
+
userData?: object
|
|
113
|
+
transportPrivate?: object
|
|
111
114
|
}
|
|
112
115
|
|
|
113
116
|
export type Purpose =
|
|
@@ -219,6 +222,7 @@ export interface HttpWTServerSessionVisitorEvent
|
|
|
219
222
|
extends HttpWTSessionVisitorEvent {
|
|
220
223
|
path: string
|
|
221
224
|
header: Object
|
|
225
|
+
userData?: Object | undefined
|
|
222
226
|
}
|
|
223
227
|
|
|
224
228
|
export interface ServerSessionRequestEvent {
|
|
@@ -228,6 +232,7 @@ export interface ServerSessionRequestEvent {
|
|
|
228
232
|
session: any
|
|
229
233
|
object?: any // the actual transport object itself, actually present on all messages, but required here
|
|
230
234
|
protocol: string //'capsule' | 'websocket' | 'http3'
|
|
235
|
+
transportPrivate?: Object //private information from the transport object
|
|
231
236
|
}
|
|
232
237
|
|
|
233
238
|
/**
|
|
@@ -291,8 +296,8 @@ export interface HttpServerInit extends HttpWebTransportInit {
|
|
|
291
296
|
port: string | number
|
|
292
297
|
host: string
|
|
293
298
|
secret: string
|
|
294
|
-
cert: string
|
|
295
|
-
privKey: string
|
|
299
|
+
cert: string | string[]
|
|
300
|
+
privKey: string | string[]
|
|
296
301
|
maxConnections?: number
|
|
297
302
|
initialStreamFlowControlWindow?: number
|
|
298
303
|
streamShouldAutoTuneReceiveWindow?: boolean
|
|
@@ -61,9 +61,10 @@ export class WebTransportPonyfill extends WebTransportBase {
|
|
|
61
61
|
* @param{{client: HttpClient, sessionint: HttpWTSession, ourl: URL}} args
|
|
62
62
|
*/
|
|
63
63
|
startUpConnection({ client, sessionint, ourl }) {
|
|
64
|
+
const path = ourl.pathname + (ourl.search ?? '')
|
|
64
65
|
client
|
|
65
|
-
.handleConnection({ createTransport: true, path
|
|
66
|
-
.then(() => client.createWTSession(sessionint,
|
|
66
|
+
.handleConnection({ createTransport: true, path })
|
|
67
|
+
.then(() => client.createWTSession(sessionint, path))
|
|
67
68
|
.catch((error) => {
|
|
68
69
|
client.closeHookSession()
|
|
69
70
|
sessionint.readyReject(error)
|
package/lib/webtransport.node.js
CHANGED
|
@@ -75,17 +75,18 @@ export class WebTransport extends WebTransportBase {
|
|
|
75
75
|
* @param{{client: HttpClient, sessionint: HttpWTSession, ourl: URL}} args
|
|
76
76
|
*/
|
|
77
77
|
startUpConnection({ client, sessionint, ourl }) {
|
|
78
|
+
const path = ourl.pathname + (ourl.search ?? '')
|
|
78
79
|
client
|
|
79
|
-
.handleConnection({ createTransport: true, path
|
|
80
|
-
.then(() => client.createWTSession(sessionint,
|
|
80
|
+
.handleConnection({ createTransport: true, path })
|
|
81
|
+
.then(() => client.createWTSession(sessionint, path))
|
|
81
82
|
.catch((error) => {
|
|
82
83
|
if (client.transportIntSwitchToReliable) {
|
|
83
84
|
log('Connecting to unreliable failed:', error)
|
|
84
85
|
log('Now switching to reliable')
|
|
85
86
|
client.transportIntSwitchToReliable()
|
|
86
87
|
client
|
|
87
|
-
.handleConnection({ createTransport: false, path
|
|
88
|
-
.then(() => client.createWTSession(sessionint,
|
|
88
|
+
.handleConnection({ createTransport: false, path })
|
|
89
|
+
.then(() => client.createWTSession(sessionint, path))
|
|
89
90
|
.catch((error) => {
|
|
90
91
|
client.closeHookSession()
|
|
91
92
|
sessionint.readyReject(error)
|
|
@@ -109,7 +110,8 @@ export class WebTransport extends WebTransportBase {
|
|
|
109
110
|
*/
|
|
110
111
|
createClient(args) {
|
|
111
112
|
let createUnreliableClient
|
|
112
|
-
|
|
113
|
+
// @ts-ignore
|
|
114
|
+
if (!quicheLoadedReady && !args?.forceReliable)
|
|
113
115
|
throw new Error('Lib quiche loading attempt did not end')
|
|
114
116
|
if (checkQuicheInit) {
|
|
115
117
|
createUnreliableClient = function (/** @type {any} */ _client) {
|
package/package.json
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @template T
|
|
3
|
-
* @typedef {import('../../lib/webstreams').ReadableStream<T>} ReadableStream<T>
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* Read a stream contents to the end and return it
|
|
8
3
|
*
|
|
9
4
|
* @template T
|
|
10
5
|
* @param {ReadableStream<T>} readable
|
|
11
6
|
* @param {number} [expected]
|
|
12
|
-
* @returns
|
|
7
|
+
* @returns {T[]}
|
|
13
8
|
*/
|
|
14
9
|
export async function readStream(readable, expected) {
|
|
15
10
|
const reader = readable.getReader()
|
|
@@ -27,7 +22,6 @@ export async function readStream(readable, expected) {
|
|
|
27
22
|
}
|
|
28
23
|
|
|
29
24
|
if (value != null) {
|
|
30
|
-
// @ts-ignore
|
|
31
25
|
outputlength += value.length
|
|
32
26
|
output.push(value)
|
|
33
27
|
}
|
|
@@ -42,3 +36,22 @@ export async function readStream(readable, expected) {
|
|
|
42
36
|
reader.releaseLock()
|
|
43
37
|
}
|
|
44
38
|
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @param {ReadableStream<Uint8Array>} stream
|
|
42
|
+
* @returns {string}
|
|
43
|
+
*/
|
|
44
|
+
export async function readStringFromStream(stream) {
|
|
45
|
+
const decoder = new TextDecoder()
|
|
46
|
+
let output = ''
|
|
47
|
+
|
|
48
|
+
for (const buf of await readStream(stream)) {
|
|
49
|
+
output += decoder.decode(buf, {
|
|
50
|
+
stream: true
|
|
51
|
+
})
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
output += decoder.decode()
|
|
55
|
+
|
|
56
|
+
return output
|
|
57
|
+
}
|
package/test/fixtures/server.js
CHANGED
|
@@ -55,6 +55,32 @@ export async function createServer() {
|
|
|
55
55
|
|
|
56
56
|
server.ready
|
|
57
57
|
.then(async () => {
|
|
58
|
+
server.setRequestCallback(async (args) => {
|
|
59
|
+
const url = args.header[':path']
|
|
60
|
+
const [path] = url.split('?')
|
|
61
|
+
|
|
62
|
+
if (server.sessionController[path] == null) {
|
|
63
|
+
return {
|
|
64
|
+
...args,
|
|
65
|
+
path,
|
|
66
|
+
status: 404
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return {
|
|
71
|
+
...args,
|
|
72
|
+
path,
|
|
73
|
+
userData: {
|
|
74
|
+
search: url.substring(path.length)
|
|
75
|
+
},
|
|
76
|
+
header: {
|
|
77
|
+
...args.header,
|
|
78
|
+
':path': path
|
|
79
|
+
},
|
|
80
|
+
status: 200
|
|
81
|
+
}
|
|
82
|
+
})
|
|
83
|
+
|
|
58
84
|
// set up listeners for the different server paths used by the tests
|
|
59
85
|
console.log('server ready')
|
|
60
86
|
await Promise.all(
|
|
@@ -310,6 +336,26 @@ export async function createServer() {
|
|
|
310
336
|
}
|
|
311
337
|
},
|
|
312
338
|
|
|
339
|
+
// support user data
|
|
340
|
+
async () => {
|
|
341
|
+
for await (const session of getReaderStream(
|
|
342
|
+
server.sessionStream('/session_with_userdata')
|
|
343
|
+
)) {
|
|
344
|
+
try {
|
|
345
|
+
const stream = await session.createUnidirectionalStream()
|
|
346
|
+
await writeStream(stream, [
|
|
347
|
+
new TextEncoder().encode(JSON.stringify(session.userData))
|
|
348
|
+
])
|
|
349
|
+
// session.close() // do not close it here, the stream is closed before a reader is attached on client side
|
|
350
|
+
} catch (err) {
|
|
351
|
+
session.close({
|
|
352
|
+
closeCode: 1,
|
|
353
|
+
reason: err.stack
|
|
354
|
+
})
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
},
|
|
358
|
+
|
|
313
359
|
// send data over unidirectional stream, initiated by remote
|
|
314
360
|
async () => {
|
|
315
361
|
for await (const session of getReaderStream(
|
package/test/session.spec.js
CHANGED
|
@@ -4,6 +4,8 @@ import { readCertHash } from './fixtures/read-cert-hash.js'
|
|
|
4
4
|
import WebTransport from './fixtures/webtransport.js'
|
|
5
5
|
import { expect } from './fixtures/chai.js'
|
|
6
6
|
import { quicheLoaded } from './fixtures/quiche.js'
|
|
7
|
+
import { getReaderValue } from './fixtures/reader-value.js'
|
|
8
|
+
import { readStringFromStream } from './fixtures/read-stream.js'
|
|
7
9
|
|
|
8
10
|
/**
|
|
9
11
|
* @template T
|
|
@@ -82,6 +84,20 @@ describe('session', function () {
|
|
|
82
84
|
expect(result).to.have.property('closeCode', 7)
|
|
83
85
|
expect(result).to.have.property('reason', 'this is the reason')
|
|
84
86
|
})
|
|
87
|
+
|
|
88
|
+
it('should parse user data', async () => {
|
|
89
|
+
client = new WebTransport(
|
|
90
|
+
`${process.env.SERVER_URL}/session_with_userdata?foo=bar`,
|
|
91
|
+
wtOptions
|
|
92
|
+
)
|
|
93
|
+
await client.ready
|
|
94
|
+
|
|
95
|
+
const stream = await getReaderValue(client.incomingUnidirectionalStreams)
|
|
96
|
+
const string = await readStringFromStream(stream)
|
|
97
|
+
const userData = JSON.parse(string)
|
|
98
|
+
expect(userData).to.have.property('search', '?foo=bar')
|
|
99
|
+
})
|
|
100
|
+
|
|
85
101
|
if (browser === 'firefox') this.timeout(31000) // really firefox?
|
|
86
102
|
it('should error when connecting to a server that does not exist', async () => {
|
|
87
103
|
client = new WebTransport(`https://127.0.0.1:39821`, {
|