h2lean 0.17.3 → 0.17.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/index.js +6 -6
- package/lib/Http2Stream.js +1328 -0
- package/lib/{client-session.js → client/Http2ClientSession.js} +28 -28
- package/lib/{client-stream.js → client/Http2ClientStream.js} +27 -782
- package/lib/{client.js → client/client.js} +4 -4
- package/lib/fast-timer.js +1 -1
- package/lib/headers.js +6 -6
- package/lib/hpack.js +1 -1
- package/lib/{session.js → server/Http2ServerSession.js} +25 -24
- package/lib/{stream.js → server/Http2ServerStream.js} +41 -1557
- package/lib/{compat.js → server/compat.js} +9 -9
- package/lib/{server.js → server/server.js} +9 -9
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
//
|
|
3
3
|
// Servers: h2c and h2s (prior-knowledge, ALPN 'h2'), the `stream` and compat
|
|
4
4
|
// (`request`) APIs. Client: `connect()` + `session.request()` over h2c and h2s
|
|
5
|
-
// (see lib/client.js); server push (pushStream / PUSH_PROMISE) on both sides.
|
|
5
|
+
// (see lib/client/client.js); server push (pushStream / PUSH_PROMISE) on both sides.
|
|
6
6
|
// Deliberately reused from node:http2, because re-typing them would only create
|
|
7
7
|
// drift: the 240 protocol constants and the `sensitiveHeaders` symbol. A peer
|
|
8
8
|
// must see the same rstCode/goawayCode numbers as with node, and user code
|
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
|
|
12
12
|
const nodeHttp2 = require('node:http2');
|
|
13
13
|
const { createServer, createSecureServer, performServerHandshake, Http2Server, Http2SecureServer,
|
|
14
|
-
Http2ServerRequest, Http2ServerResponse } = require('./lib/server');
|
|
15
|
-
const { Http2Session, OUR_DEFAULTS, PEER_DEFAULTS, SETTINGS_BY_ID, ID_BY_SETTING,
|
|
16
|
-
checkSettings, buildSubmission, submissionValues, extError, received } = require('./lib/
|
|
14
|
+
Http2ServerRequest, Http2ServerResponse } = require('./lib/server/server');
|
|
15
|
+
const { Http2ServerSession: Http2Session, OUR_DEFAULTS, PEER_DEFAULTS, SETTINGS_BY_ID, ID_BY_SETTING,
|
|
16
|
+
checkSettings, buildSubmission, submissionValues, extError, received } = require('./lib/server/Http2ServerSession');
|
|
17
17
|
const { DATA, HEADERS, PRIORITY, RST_STREAM, SETTINGS, PUSH_PROMISE, PING, GOAWAY,
|
|
18
18
|
WINDOW_UPDATE, CONTINUATION } = require('./lib/frames');
|
|
19
19
|
const { Decoder, Encoder, HPackError } = require('./lib/hpack');
|
|
20
|
-
const { connect } = require('./lib/client');
|
|
20
|
+
const { connect } = require('./lib/client/client');
|
|
21
21
|
|
|
22
22
|
// node's getPackedSettings (core.js): assertIsObject + validateSettings, then
|
|
23
23
|
// updateSettingsBuffer -- the same packer every submission uses -- so the blob carries
|
|
@@ -31,7 +31,7 @@ const { connect } = require('./lib/client');
|
|
|
31
31
|
// (ENABLE_PUSH), {customSettings: {6: 2}} (ENABLE_CONNECT_PROTOCOL) and
|
|
32
32
|
// {customSettings: {3: 16383}} (MAX_FRAME_SIZE) all return undefined with no throw. The
|
|
33
33
|
// same values through session.settings() abort node natively instead; that divergence is
|
|
34
|
-
// the one lib/client
|
|
34
|
+
// the one lib/client/Http2ClientSession.js writes down. The named ranges are already enforced by
|
|
35
35
|
// checkSettings, so what can reach here out of definition is a value folded out of
|
|
36
36
|
// customSettings -- and a named value in the same call replaces its fold.
|
|
37
37
|
function nghttp2Accepts(folded) {
|