@gjsify/http2 0.3.13 → 0.3.15
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/lib/esm/client-session.js +266 -272
- package/lib/esm/index.js +39 -85
- package/lib/esm/protocol.js +332 -307
- package/lib/esm/server.js +588 -609
- package/package.json +9 -9
package/lib/esm/index.js
CHANGED
|
@@ -1,94 +1,48 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} from "./protocol.js";
|
|
7
|
-
import { constants as constants2, getDefaultSettings as getDefaultSettings2, getPackedSettings as getPackedSettings2, getUnpackedSettings as getUnpackedSettings2 } from "./protocol.js";
|
|
8
|
-
import {
|
|
9
|
-
Http2ServerRequest,
|
|
10
|
-
Http2ServerResponse,
|
|
11
|
-
ServerHttp2Stream,
|
|
12
|
-
ServerHttp2Session,
|
|
13
|
-
Http2Server,
|
|
14
|
-
Http2SecureServer
|
|
15
|
-
} from "./server.js";
|
|
16
|
-
import {
|
|
17
|
-
Http2ServerRequest as Http2ServerRequest2,
|
|
18
|
-
Http2ServerResponse as Http2ServerResponse2,
|
|
19
|
-
ServerHttp2Stream as ServerHttp2Stream2,
|
|
20
|
-
ServerHttp2Session as ServerHttp2Session2,
|
|
21
|
-
Http2Server as Http2Server2,
|
|
22
|
-
Http2SecureServer as Http2SecureServer2
|
|
23
|
-
} from "./server.js";
|
|
24
|
-
import {
|
|
25
|
-
Http2Session,
|
|
26
|
-
ClientHttp2Session,
|
|
27
|
-
ClientHttp2Stream
|
|
28
|
-
} from "./client-session.js";
|
|
29
|
-
import {
|
|
30
|
-
Http2Session as Http2Session2,
|
|
31
|
-
ClientHttp2Session as ClientHttp2Session2,
|
|
32
|
-
ClientHttp2Stream as ClientHttp2Stream2
|
|
33
|
-
} from "./client-session.js";
|
|
1
|
+
import { constants, getDefaultSettings, getPackedSettings, getUnpackedSettings } from "./protocol.js";
|
|
2
|
+
import { ClientHttp2Session, ClientHttp2Stream, Http2Session } from "./client-session.js";
|
|
3
|
+
import { Http2SecureServer, Http2Server, Http2ServerRequest, Http2ServerResponse, ServerHttp2Session, ServerHttp2Stream } from "./server.js";
|
|
4
|
+
|
|
5
|
+
//#region src/index.ts
|
|
34
6
|
function createServer(options, handler) {
|
|
35
|
-
|
|
7
|
+
return new Http2Server(options, handler);
|
|
36
8
|
}
|
|
37
9
|
function createSecureServer(options, handler) {
|
|
38
|
-
|
|
10
|
+
return new Http2SecureServer(options, handler);
|
|
39
11
|
}
|
|
40
12
|
function connect(authority, options, listener) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
13
|
+
const authorityStr = typeof authority === "string" ? authority : authority.toString();
|
|
14
|
+
if (typeof options === "function") {
|
|
15
|
+
listener = options;
|
|
16
|
+
options = {};
|
|
17
|
+
}
|
|
18
|
+
const session = new ClientHttp2Session(authorityStr, options ?? {});
|
|
19
|
+
if (listener) session.once("connect", listener);
|
|
20
|
+
return session;
|
|
49
21
|
}
|
|
50
|
-
const sensitiveHeaders =
|
|
22
|
+
const sensitiveHeaders = Symbol.for("nodejs.http2.sensitiveHeaders");
|
|
51
23
|
function performServerHandshake(_socket) {
|
|
52
|
-
|
|
24
|
+
throw new Error("http2.performServerHandshake() is not yet implemented in GJS");
|
|
53
25
|
}
|
|
54
|
-
var
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
};
|
|
74
|
-
export {
|
|
75
|
-
ClientHttp2Session,
|
|
76
|
-
ClientHttp2Stream,
|
|
77
|
-
Http2SecureServer,
|
|
78
|
-
Http2Server,
|
|
79
|
-
Http2ServerRequest,
|
|
80
|
-
Http2ServerResponse,
|
|
81
|
-
Http2Session,
|
|
82
|
-
ServerHttp2Session,
|
|
83
|
-
ServerHttp2Stream,
|
|
84
|
-
connect,
|
|
85
|
-
constants,
|
|
86
|
-
createSecureServer,
|
|
87
|
-
createServer,
|
|
88
|
-
index_default as default,
|
|
89
|
-
getDefaultSettings,
|
|
90
|
-
getPackedSettings,
|
|
91
|
-
getUnpackedSettings,
|
|
92
|
-
performServerHandshake,
|
|
93
|
-
sensitiveHeaders
|
|
26
|
+
var src_default = {
|
|
27
|
+
constants,
|
|
28
|
+
createServer,
|
|
29
|
+
createSecureServer,
|
|
30
|
+
connect,
|
|
31
|
+
getDefaultSettings,
|
|
32
|
+
getPackedSettings,
|
|
33
|
+
getUnpackedSettings,
|
|
34
|
+
sensitiveHeaders,
|
|
35
|
+
performServerHandshake,
|
|
36
|
+
Http2Session,
|
|
37
|
+
Http2Server,
|
|
38
|
+
Http2SecureServer,
|
|
39
|
+
Http2ServerRequest,
|
|
40
|
+
Http2ServerResponse,
|
|
41
|
+
ServerHttp2Session,
|
|
42
|
+
ServerHttp2Stream,
|
|
43
|
+
ClientHttp2Session,
|
|
44
|
+
ClientHttp2Stream
|
|
94
45
|
};
|
|
46
|
+
|
|
47
|
+
//#endregion
|
|
48
|
+
export { ClientHttp2Session, ClientHttp2Stream, Http2SecureServer, Http2Server, Http2ServerRequest, Http2ServerResponse, Http2Session, ServerHttp2Session, ServerHttp2Stream, connect, constants, createSecureServer, createServer, src_default as default, getDefaultSettings, getPackedSettings, getUnpackedSettings, performServerHandshake, sensitiveHeaders };
|