@fastls/fastls 0.14.0 → 0.15.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/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Fastls Node.js SDK
2
2
 
3
+ Python 0.6.0 / Node 0.15.0 支持显式 H3 与可信 Session 地址策略组合,需原生 `http3_address_policy_v1`;默认校验证书,旧库在分配资源前拒绝。详见 [组合契约](https://github.com/FastTLS/fastls-ffi/blob/main/H3_POLICY.zh-CN.md)。
4
+
3
5
  Node 0.14.0 增加完整 Spec 的 H2 首流编号与初始流窗口配置,并导出 `HTTP2StreamConfig` 类型。省略保持旧行为,需要 `http2.stream.v1` 和原生 `http2_stream_v1`;转换、Bundle/Store、Session/fetch 共用契约。旧原生库明确拒绝,窗口预算及候选采用边界见 [中文契约](https://github.com/FastTLS/fastls-ffi/blob/main/FINGERPRINTS.zh-CN.md)。
4
6
 
5
7
  Node 0.11.0 起支持 Session `addressPolicy`、`profileSpec: new ProfileSpec(...)` 和
@@ -39,7 +41,7 @@ Node.js 22+ 的 Fastls C ABI v1 绑定,提供 Promise API、TypeScript 声明
39
41
  安装指定版本:
40
42
 
41
43
  ```sh
42
- npm install @fastls/fastls@0.13.0
44
+ npm install @fastls/fastls@0.15.0
43
45
  ```
44
46
 
45
47
  主包通过同版本的可选依赖自动安装当前平台的 Fastls 原生库。保留 optional dependencies;支持 Windows x64、Linux glibc x64/arm64、macOS x64/arm64。Linux musl 和其它架构没有内置包。具体系统最低版本见原生包的 `native/manifest.json`。
package/dist/session.d.ts CHANGED
@@ -75,6 +75,7 @@ export declare class Session {
75
75
  static open(options?: SessionOptions): Promise<Session>;
76
76
  readonly notificationMode: "async-events" | "poll";
77
77
  readonly cookies: Cookies;
78
+ private readonly hasAddressPolicy;
78
79
  private readonly native;
79
80
  private readonly handle;
80
81
  private readonly profile;
package/dist/session.js CHANGED
@@ -66,6 +66,7 @@ class Session {
66
66
  }
67
67
  notificationMode;
68
68
  cookies;
69
+ hasAddressPolicy;
69
70
  native;
70
71
  handle;
71
72
  profile;
@@ -87,6 +88,7 @@ class Session {
87
88
  constructor(options = {}) {
88
89
  if (options.retry !== undefined && !(options.retry instanceof retry_js_1.RetryPolicy))
89
90
  throw new TypeError("retry must be RetryPolicy");
91
+ this.hasAddressPolicy = options.addressPolicy !== undefined;
90
92
  this.retry = options.retry;
91
93
  this.proxy = proxyValue(options.proxy);
92
94
  this.proxyCaPem = proxyTrust(options.proxyCaFile);
@@ -134,6 +136,8 @@ class Session {
134
136
  if (options.httpVersion === "h3") {
135
137
  configuration.http_version = "h3";
136
138
  required.push("http3_v1");
139
+ if (this.hasAddressPolicy && options.httpVersion === "h3")
140
+ required.push("http3_address_policy_v1");
137
141
  }
138
142
  if (required.length) {
139
143
  this.native.requireCapabilities(required);
@@ -272,6 +276,8 @@ class Session {
272
276
  if (!["auto", "h3"].includes(options.httpVersion))
273
277
  throw new TypeError("httpVersion must be auto or h3");
274
278
  required.push("http3_v1");
279
+ if (this.hasAddressPolicy && options.httpVersion === "h3")
280
+ required.push("http3_address_policy_v1");
275
281
  }
276
282
  if (required.length)
277
283
  this.native.requireCapabilities(required);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fastls/fastls",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "description": "Node.js bindings for the Fastls C ABI",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -35,10 +35,10 @@
35
35
  "registry": "https://registry.npmjs.org/"
36
36
  },
37
37
  "optionalDependencies": {
38
- "@fastls/fastls-win32-x64": "0.14.0",
39
- "@fastls/fastls-linux-x64-glibc": "0.14.0",
40
- "@fastls/fastls-linux-arm64-glibc": "0.14.0",
41
- "@fastls/fastls-darwin-x64": "0.14.0",
42
- "@fastls/fastls-darwin-arm64": "0.14.0"
38
+ "@fastls/fastls-win32-x64": "0.15.0",
39
+ "@fastls/fastls-linux-x64-glibc": "0.15.0",
40
+ "@fastls/fastls-linux-arm64-glibc": "0.15.0",
41
+ "@fastls/fastls-darwin-x64": "0.15.0",
42
+ "@fastls/fastls-darwin-arm64": "0.15.0"
43
43
  }
44
44
  }