@maiyunnet/kebab 9.26.3 → 9.26.5

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/doc/kebab-rag.md CHANGED
@@ -60,6 +60,36 @@ const results = await lCore.sendVhost({
60
60
 
61
61
  控制器通过 `this._config.const.hostCanonical` 获取用于 URL 的主机地址:HTTPS 的 443 和 HTTP 的 80 端口会省略,其余端口及 IPv6 方括号保留。`host`、`hostname` 和 `hostport` 保留原有含义。`urlOrigin`、`urlFull` 和 `urlStcFull` 使用 `hostCanonical` 生成,SSR 注入的 `_urlFull`、默认 `_staticPathFull` 同步省略默认端口。
62
62
 
63
+ ## 代理请求头模式
64
+
65
+ `lib/undici` 和 `lib/ws` 的 `rproxy` 支持三种 `proxyMode`,`mproxy` 支持 `passthrough` 和 `request`:
66
+
67
+ | 值 | 请求头行为 |
68
+ |---|---|
69
+ | `passthrough`(默认) | 使用目标 Host,其余通过基础过滤的头继续透传,包括已有代理及 CDN 来源头,不自动生成来源头 |
70
+ | `request` | 使用目标 Host,清理已有代理来源头,不主动提供原始访问的主机、协议或 IP |
71
+ | `reverse` | 使用外部 Host(HTTP/2 优先 `:authority`),设置 `X-Forwarded-Host`、`X-Forwarded-Proto`、`X-Forwarded-For`、`X-Real-IP` |
72
+
73
+ 不传 `proxyMode` 等同于 `passthrough`,保留既有行为。透传仍经过基础过滤及业务 `filter`,连接控制头和 HTTP/2 伪头不直接转发。
74
+
75
+ `reverse` 的协议和 IP 默认来自实际连接;`request` 和 `reverse` 均清理已有来源头,避免把来路自报的信息当成可信代理信息。清理范围见 [getProxyHeaders](api/lib/undici/proxy/variables/getProxyHeaders.md)。原 Host 的非默认端口和 IPv6 方括号原样保留,目标 URL 仍决定连接地址和 TLS 目标名称。
76
+
77
+ `mproxy` 的入站 Host 是代理入口,目标地址来自 `url` 参数,因此不支持 `reverse`。在提供 `mproxy` 服务的控制器中设置 `proxyMode`;它不属于客户端 `request` 或 `connect` 的 `mproxy` 连接配置。
78
+
79
+ ```ts
80
+ await lUndici.rproxy(this, {
81
+ '': 'http://origin.example.test/',
82
+ }, {
83
+ 'proxyMode': 'reverse',
84
+ });
85
+ ```
86
+
87
+ `headers` 是业务显式覆盖,优先于模式结果,头名不区分大小写。经过可信 CDN 时,先验证 CDN 身份,再通过 `headers` 提供已验证的外部协议和客户端 IP;不能直接信任公网传入的 `X-Forwarded-*`。Gitea 等应用仍须正确设置自身对外 URL。
88
+
89
+ `filter` 继续负责来路及响应头过滤;模式仅处理发往上游的请求头,不改变响应头。Cookie、Authorization、Origin、Referer 保留原有业务语义,业务可显式过滤或覆盖。`request` 不保证无法识别代理;旧调用迁入此模式前应确认没有依赖 CDN 来源头。
90
+
91
+ `lib/undici/proxy.getProxyHeaders(req, opt)` 统一完成请求头的基础过滤、业务 `filter`、模式处理和 `headers` 覆盖。`lib/undici.filterProxyHeaders(headers, res?, filter?)` 仅做基础过滤,也可直接设置响应头;它不处理请求来源模式。
92
+
63
93
  ## 集成 JSON Schema
64
94
 
65
95
  控制器的 `_checkInput` 方法已集成 JSON Schema(ajv、ajv-formats),可通过 `schema` 参数使用,例如:
@@ -1534,6 +1564,7 @@ index.md
1534
1564
  - [lib/turnstile](lib/turnstile/index.md)
1535
1565
  - [lib/undici](lib/undici/index.md)
1536
1566
  - [lib/undici/formdata](lib/undici/formdata/index.md)
1567
+ - [lib/undici/proxy](lib/undici/proxy/index.md)
1537
1568
  - [lib/undici/request](lib/undici/request/index.md)
1538
1569
  - [lib/undici/response](lib/undici/response/index.md)
1539
1570
  - [lib/vector](lib/vector/index.md)
@@ -1763,7 +1794,7 @@ index/variables/VER.md
1763
1794
 
1764
1795
  # Variable: VER
1765
1796
 
1766
- > `const` **VER**: `"9.26.3"` = `'9.26.3'`
1797
+ > `const` **VER**: `"9.26.5"` = `'9.26.5'`
1767
1798
 
1768
1799
  Defined in: [index.ts:9](https://github.com/maiyunnet/kebab/blob/master/index.ts#L9)
1769
1800
 
@@ -128841,7 +128872,7 @@ lib/undici/functions/fetch.md
128841
128872
 
128842
128873
  > **fetch**(`input`, `init?`): `Promise`\<`Response`\>
128843
128874
 
128844
- Defined in: [lib/undici.ts:293](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L293)
128875
+ Defined in: [lib/undici.ts:294](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L294)
128845
128876
 
128846
128877
  发起一个完全兼容 fetch 的请求
128847
128878
 
@@ -128863,47 +128894,6 @@ Defined in: [lib/undici.ts:293](https://github.com/maiyunnet/kebab/blob/master/l
128863
128894
 
128864
128895
  `Promise`\<`Response`\>
128865
128896
 
128866
- lib/undici/functions/filterHeaders.md
128867
- ---
128868
-
128869
- [**Documents for @maiyunnet/kebab**](../../../index.md)
128870
-
128871
- ***
128872
-
128873
- [Documents for @maiyunnet/kebab](../../../index.md) / [lib/undici](../index.md) / filterHeaders
128874
-
128875
- # Function: filterHeaders()
128876
-
128877
- > **filterHeaders**(`headers`, `res?`, `filter?`): `Record`\<`string`, `string` \| `string`[]\>
128878
-
128879
- Defined in: [lib/undici.ts:673](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L673)
128880
-
128881
- 剔除不代理的 header,返回新的 header
128882
-
128883
- ## Parameters
128884
-
128885
- ### headers
128886
-
128887
- `IncomingHttpHeaders` \| `IncomingHttpHeaders` \| [`THttpHeaders`](../type-aliases/THttpHeaders.md)
128888
-
128889
- 剔除前的 header
128890
-
128891
- ### res?
128892
-
128893
- `Http2ServerResponse`\<`Http2ServerRequest`\> \| `ServerResponse`\<`IncomingMessage`\>
128894
-
128895
- 直接设置头部而不返回,可置空
128896
-
128897
- ### filter?
128898
-
128899
- (`h`) => `boolean`
128900
-
128901
- 返回 true 则留下
128902
-
128903
- ## Returns
128904
-
128905
- `Record`\<`string`, `string` \| `string`[]\>
128906
-
128907
128897
  lib/undici/functions/getFormData.md
128908
128898
  ---
128909
128899
 
@@ -128917,7 +128907,7 @@ lib/undici/functions/getFormData.md
128917
128907
 
128918
128908
  > **getFormData**(): [`FormData`](../formdata/classes/FormData.md)
128919
128909
 
128920
- Defined in: [lib/undici.ts:657](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L657)
128910
+ Defined in: [lib/undici.ts:658](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L658)
128921
128911
 
128922
128912
  创建 FormData 对象
128923
128913
 
@@ -128938,7 +128928,7 @@ lib/undici/functions/get.md
128938
128928
 
128939
128929
  > **get**(`u`, `opt?`): `Promise`\<[`Response`](../response/classes/Response.md)\>
128940
128930
 
128941
- Defined in: [lib/undici.ts:169](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L169)
128931
+ Defined in: [lib/undici.ts:170](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L170)
128942
128932
 
128943
128933
  发起一个 get 请求
128944
128934
 
@@ -128973,7 +128963,7 @@ lib/undici/functions/getProxyAgent.md
128973
128963
 
128974
128964
  > **getProxyAgent**(`url`): `ProxyAgent`
128975
128965
 
128976
- Defined in: [lib/undici.ts:21](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L21)
128966
+ Defined in: [lib/undici.ts:22](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L22)
128977
128967
 
128978
128968
  获取代理 agent
128979
128969
 
@@ -129000,7 +128990,7 @@ lib/undici/functions/getResponseJson.md
129000
128990
 
129001
128991
  > **getResponseJson**(`u`, `opt?`): `Promise`\<`any`\>
129002
128992
 
129003
- Defined in: [lib/undici.ts:281](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L281)
128993
+ Defined in: [lib/undici.ts:282](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L282)
129004
128994
 
129005
128995
  发起 GET 请求并解析 JSON 响应
129006
128996
 
@@ -129037,7 +129027,7 @@ lib/undici/functions/mproxyData.md
129037
129027
 
129038
129028
  > **mproxyData**(`ctr`): `any`
129039
129029
 
129040
- Defined in: [lib/undici.ts:779](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L779)
129030
+ Defined in: [lib/undici.ts:748](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L748)
129041
129031
 
129042
129032
  获取 mproxy 的附加数据
129043
129033
 
@@ -129066,7 +129056,7 @@ lib/undici/functions/mproxy.md
129066
129056
 
129067
129057
  > **mproxy**(`ctr`, `auth`, `opt?`): `Promise`\<`number`\>
129068
129058
 
129069
- Defined in: [lib/undici.ts:713](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L713)
129059
+ Defined in: [lib/undici.ts:682](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L682)
129070
129060
 
129071
129061
  正向 mproxy 代理,注意提前处理不要自动处理 post 数据,读取 get 的 url 为实际请求地址
129072
129062
  get: url, auth
@@ -129108,7 +129098,7 @@ lib/undici/functions/open.md
129108
129098
 
129109
129099
  > **open**(`u`): [`Request`](../request/classes/Request.md)
129110
129100
 
129111
- Defined in: [lib/undici.ts:160](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L160)
129101
+ Defined in: [lib/undici.ts:161](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L161)
129112
129102
 
129113
129103
  创建一个请求对象
129114
129104
 
@@ -129135,7 +129125,7 @@ lib/undici/functions/postJson.md
129135
129125
 
129136
129126
  > **postJson**(`u`, `data`, `opt?`): `Promise`\<[`Response`](../response/classes/Response.md)\>
129137
129127
 
129138
- Defined in: [lib/undici.ts:194](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L194)
129128
+ Defined in: [lib/undici.ts:195](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L195)
129139
129129
 
129140
129130
  发起 JSON 请求
129141
129131
 
@@ -129176,7 +129166,7 @@ lib/undici/functions/postJsonResponseJson.md
129176
129166
 
129177
129167
  > **postJsonResponseJson**(`u`, `data`, `opt?`): `Promise`\<`any`\>
129178
129168
 
129179
- Defined in: [lib/undici.ts:253](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L253)
129169
+ Defined in: [lib/undici.ts:254](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L254)
129180
129170
 
129181
129171
  发起 JSON 请求并解析 JSON 响应
129182
129172
 
@@ -129219,7 +129209,7 @@ lib/undici/functions/post.md
129219
129209
 
129220
129210
  > **post**(`u`, `data`, `opt?`): `Promise`\<[`Response`](../response/classes/Response.md)\>
129221
129211
 
129222
- Defined in: [lib/undici.ts:179](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L179)
129212
+ Defined in: [lib/undici.ts:180](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L180)
129223
129213
 
129224
129214
  发起一个 post 请求
129225
129215
 
@@ -129260,7 +129250,7 @@ lib/undici/functions/postResponseJson.md
129260
129250
 
129261
129251
  > **postResponseJson**(`u`, `data`, `opt?`): `Promise`\<`any`\>
129262
129252
 
129263
- Defined in: [lib/undici.ts:268](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L268)
129253
+ Defined in: [lib/undici.ts:269](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L269)
129264
129254
 
129265
129255
  发起 POST 请求并解析 JSON 响应
129266
129256
 
@@ -129303,7 +129293,7 @@ lib/undici/functions/request.md
129303
129293
 
129304
129294
  > **request**(`u`, `data?`, `opt?`): `Promise`\<[`Response`](../response/classes/Response.md)\>
129305
129295
 
129306
- Defined in: [lib/undici.ts:471](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L471)
129296
+ Defined in: [lib/undici.ts:472](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L472)
129307
129297
 
129308
129298
  发起一个请求
129309
129299
 
@@ -129340,7 +129330,7 @@ lib/undici/functions/rproxy.md
129340
129330
 
129341
129331
  > **rproxy**(`ctr`, `route`, `opt?`): `Promise`\<`boolean`\>
129342
129332
 
129343
- Defined in: [lib/undici.ts:809](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L809)
129333
+ Defined in: [lib/undici.ts:778](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L778)
129344
129334
 
129345
129335
  反向代理,将本服务器的某个路由反代到其他网址
129346
129336
 
@@ -129400,10 +129390,13 @@ lib/undici/index.md
129400
129390
 
129401
129391
  - [THttpHeaders](type-aliases/THttpHeaders.md)
129402
129392
 
129393
+ ## Variables
129394
+
129395
+ - [filterProxyHeaders](variables/filterProxyHeaders.md)
129396
+
129403
129397
  ## Functions
129404
129398
 
129405
129399
  - [fetch](functions/fetch.md)
129406
- - [filterHeaders](functions/filterHeaders.md)
129407
129400
  - [get](functions/get.md)
129408
129401
  - [getFormData](functions/getFormData.md)
129409
129402
  - [getProxyAgent](functions/getProxyAgent.md)
@@ -129429,7 +129422,7 @@ lib/undici/interfaces/IMproxyOptions.md
129429
129422
 
129430
129423
  # Interface: IMproxyOptions
129431
129424
 
129432
- Defined in: [lib/undici.ts:944](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L944)
129425
+ Defined in: [lib/undici.ts:913](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L913)
129433
129426
 
129434
129427
  正向代理请求的传入参数选项
129435
129428
 
@@ -129439,7 +129432,7 @@ Defined in: [lib/undici.ts:944](https://github.com/maiyunnet/kebab/blob/master/l
129439
129432
 
129440
129433
  > `optional` **filter?**: (`h`) => `boolean`
129441
129434
 
129442
- Defined in: [lib/undici.ts:957](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L957)
129435
+ Defined in: [lib/undici.ts:928](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L928)
129443
129436
 
129444
129437
  过滤 header,返回 true 则留下
129445
129438
 
@@ -129459,7 +129452,7 @@ Defined in: [lib/undici.ts:957](https://github.com/maiyunnet/kebab/blob/master/l
129459
129452
 
129460
129453
  > `optional` **follow?**: `number`
129461
129454
 
129462
- Defined in: [lib/undici.ts:947](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L947)
129455
+ Defined in: [lib/undici.ts:918](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L918)
129463
129456
 
129464
129457
  ***
129465
129458
 
@@ -129467,7 +129460,7 @@ Defined in: [lib/undici.ts:947](https://github.com/maiyunnet/kebab/blob/master/l
129467
129460
 
129468
129461
  > `optional` **headers?**: [`THttpHeaders`](../type-aliases/THttpHeaders.md)
129469
129462
 
129470
- Defined in: [lib/undici.ts:951](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L951)
129463
+ Defined in: [lib/undici.ts:922](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L922)
129471
129464
 
129472
129465
  ***
129473
129466
 
@@ -129475,7 +129468,7 @@ Defined in: [lib/undici.ts:951](https://github.com/maiyunnet/kebab/blob/master/l
129475
129468
 
129476
129469
  > `optional` **hosts?**: `string` \| `Record`\<`string`, `string`\>
129477
129470
 
129478
- Defined in: [lib/undici.ts:949](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L949)
129471
+ Defined in: [lib/undici.ts:920](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L920)
129479
129472
 
129480
129473
  自定义 host 映射,如 {'www.maiyun.net': '127.0.0.1'},或全部映射到一个 host
129481
129474
 
@@ -129485,7 +129478,7 @@ Defined in: [lib/undici.ts:949](https://github.com/maiyunnet/kebab/blob/master/l
129485
129478
 
129486
129479
  > `optional` **keepAliveTimeout?**: `number`
129487
129480
 
129488
- Defined in: [lib/undici.ts:953](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L953)
129481
+ Defined in: [lib/undici.ts:924](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L924)
129489
129482
 
129490
129483
  空闲连接允许复用的最长秒数;非正数或无效值按未设置处理;默认无服务端提示时为 4 秒,有提示时采用提示值减 2 秒且最多 600 秒
129491
129484
 
@@ -129495,7 +129488,17 @@ Defined in: [lib/undici.ts:953](https://github.com/maiyunnet/kebab/blob/master/l
129495
129488
 
129496
129489
  > `optional` **local?**: `string`
129497
129490
 
129498
- Defined in: [lib/undici.ts:950](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L950)
129491
+ Defined in: [lib/undici.ts:921](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L921)
129492
+
129493
+ ***
129494
+
129495
+ ### proxyMode?
129496
+
129497
+ > `optional` **proxyMode?**: `"request"` \| `"passthrough"`
129498
+
129499
+ Defined in: [lib/undici.ts:915](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L915)
129500
+
129501
+ 默认 passthrough 保留已有来源头;request 清理来源头;两者均使用目标 Host
129499
129502
 
129500
129503
  ***
129501
129504
 
@@ -129503,7 +129506,7 @@ Defined in: [lib/undici.ts:950](https://github.com/maiyunnet/kebab/blob/master/l
129503
129506
 
129504
129507
  > `optional` **reuse?**: `string` \| `Agent` \| `ProxyAgent`
129505
129508
 
129506
- Defined in: [lib/undici.ts:959](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L959)
129509
+ Defined in: [lib/undici.ts:930](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L930)
129507
129510
 
129508
129511
  默认为 default
129509
129512
 
@@ -129513,7 +129516,7 @@ Defined in: [lib/undici.ts:959](https://github.com/maiyunnet/kebab/blob/master/l
129513
129516
 
129514
129517
  > `optional` **reuseTimeout?**: `number`
129515
129518
 
129516
- Defined in: [lib/undici.ts:955](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L955)
129519
+ Defined in: [lib/undici.ts:926](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L926)
129517
129520
 
129518
129521
  连接建立后允许承接新请求的最长秒数;非正数或无效值按未设置处理;达到后不再复用但不会中断在途请求,默认不限制
129519
129522
 
@@ -129523,7 +129526,7 @@ Defined in: [lib/undici.ts:955](https://github.com/maiyunnet/kebab/blob/master/l
129523
129526
 
129524
129527
  > `optional` **timeout?**: `number`
129525
129528
 
129526
- Defined in: [lib/undici.ts:946](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L946)
129529
+ Defined in: [lib/undici.ts:917](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L917)
129527
129530
 
129528
129531
  秒数,默认 300 秒
129529
129532
 
@@ -129538,7 +129541,7 @@ lib/undici/interfaces/IRequestOptions.md
129538
129541
 
129539
129542
  # Interface: IRequestOptions
129540
129543
 
129541
- Defined in: [lib/undici.ts:901](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L901)
129544
+ Defined in: [lib/undici.ts:870](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L870)
129542
129545
 
129543
129546
  请求的传入参数选项
129544
129547
 
@@ -129548,7 +129551,7 @@ Defined in: [lib/undici.ts:901](https://github.com/maiyunnet/kebab/blob/master/l
129548
129551
 
129549
129552
  > `optional` **cookie?**: `Record`\<`string`, [`ICookie`](../../cookie/interfaces/ICookie.md)\>
129550
129553
 
129551
- Defined in: [lib/undici.ts:936](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L936)
129554
+ Defined in: [lib/undici.ts:905](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L905)
129552
129555
 
129553
129556
  cookie 托管对象
129554
129557
 
@@ -129558,7 +129561,7 @@ cookie 托管对象
129558
129561
 
129559
129562
  > `optional` **follow?**: `number`
129560
129563
 
129561
- Defined in: [lib/undici.ts:913](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L913)
129564
+ Defined in: [lib/undici.ts:882](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L882)
129562
129565
 
129563
129566
  追踪 location 次数,0 为不追踪,默认为 0
129564
129567
 
@@ -129568,7 +129571,7 @@ Defined in: [lib/undici.ts:913](https://github.com/maiyunnet/kebab/blob/master/l
129568
129571
 
129569
129572
  > `optional` **headers?**: [`THttpHeaders`](../type-aliases/THttpHeaders.md)
129570
129573
 
129571
- Defined in: [lib/undici.ts:918](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L918)
129574
+ Defined in: [lib/undici.ts:887](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L887)
129572
129575
 
129573
129576
  ***
129574
129577
 
@@ -129576,7 +129579,7 @@ Defined in: [lib/undici.ts:918](https://github.com/maiyunnet/kebab/blob/master/l
129576
129579
 
129577
129580
  > `optional` **hosts?**: `string` \| `Record`\<`string`, `string`\>
129578
129581
 
129579
- Defined in: [lib/undici.ts:915](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L915)
129582
+ Defined in: [lib/undici.ts:884](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L884)
129580
129583
 
129581
129584
  自定义 host 映射,如 {'www.maiyun.net': '127.0.0.1'},或全部映射到一个 host
129582
129585
 
@@ -129586,7 +129589,7 @@ Defined in: [lib/undici.ts:915](https://github.com/maiyunnet/kebab/blob/master/l
129586
129589
 
129587
129590
  > `optional` **keep?**: `boolean`
129588
129591
 
129589
- Defined in: [lib/undici.ts:928](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L928)
129592
+ Defined in: [lib/undici.ts:897](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L897)
129590
129593
 
129591
129594
  连接是否保持长连接(即是否允许复用),默认为 true
129592
129595
 
@@ -129596,7 +129599,7 @@ Defined in: [lib/undici.ts:928](https://github.com/maiyunnet/kebab/blob/master/l
129596
129599
 
129597
129600
  > `optional` **keepAliveTimeout?**: `number`
129598
129601
 
129599
- Defined in: [lib/undici.ts:930](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L930)
129602
+ Defined in: [lib/undici.ts:899](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L899)
129600
129603
 
129601
129604
  空闲连接允许复用的最长秒数;非正数或无效值按未设置处理;默认无服务端提示时为 4 秒,有提示时采用提示值减 2 秒且最多 600 秒;自定义 Agent 由其自身配置
129602
129605
 
@@ -129606,7 +129609,7 @@ Defined in: [lib/undici.ts:930](https://github.com/maiyunnet/kebab/blob/master/l
129606
129609
 
129607
129610
  > `optional` **local?**: `string`
129608
129611
 
129609
- Defined in: [lib/undici.ts:917](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L917)
129612
+ Defined in: [lib/undici.ts:886](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L886)
129610
129613
 
129611
129614
  ***
129612
129615
 
@@ -129614,7 +129617,7 @@ Defined in: [lib/undici.ts:917](https://github.com/maiyunnet/kebab/blob/master/l
129614
129617
 
129615
129618
  > `optional` **log?**: `boolean`
129616
129619
 
129617
- Defined in: [lib/undici.ts:938](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L938)
129620
+ Defined in: [lib/undici.ts:907](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L907)
129618
129621
 
129619
129622
  若有异常写入文件日志,默认为 true
129620
129623
 
@@ -129624,7 +129627,7 @@ Defined in: [lib/undici.ts:938](https://github.com/maiyunnet/kebab/blob/master/l
129624
129627
 
129625
129628
  > `optional` **method?**: `"GET"` \| `"POST"` \| `"PUT"` \| `"DELETE"` \| `"OPTIONS"`
129626
129629
 
129627
- Defined in: [lib/undici.ts:902](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L902)
129630
+ Defined in: [lib/undici.ts:871](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L871)
129628
129631
 
129629
129632
  ***
129630
129633
 
@@ -129632,7 +129635,7 @@ Defined in: [lib/undici.ts:902](https://github.com/maiyunnet/kebab/blob/master/l
129632
129635
 
129633
129636
  > `optional` **mproxy?**: `object`
129634
129637
 
129635
- Defined in: [lib/undici.ts:920](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L920)
129638
+ Defined in: [lib/undici.ts:889](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L889)
129636
129639
 
129637
129640
  正向 mproxy 代理,url 如 https://xxx/abc
129638
129641
 
@@ -129660,7 +129663,7 @@ Defined in: [lib/undici.ts:920](https://github.com/maiyunnet/kebab/blob/master/l
129660
129663
 
129661
129664
  > `optional` **retry?**: `number`
129662
129665
 
129663
- Defined in: [lib/undici.ts:907](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L907)
129666
+ Defined in: [lib/undici.ts:876](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L876)
129664
129667
 
129665
129668
  网络异常后的重试次数,默认 0;流式请求体不可重试,非幂等请求需由调用方保证安全
129666
129669
 
@@ -129670,7 +129673,7 @@ Defined in: [lib/undici.ts:907](https://github.com/maiyunnet/kebab/blob/master/l
129670
129673
 
129671
129674
  > `optional` **retryJson?**: `number`
129672
129675
 
129673
- Defined in: [lib/undici.ts:909](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L909)
129676
+ Defined in: [lib/undici.ts:878](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L878)
129674
129677
 
129675
129678
  JSON 解析失败或重试验证未通过后的重试次数,默认 0;仅适用于 ResponseJson 快捷方法,非幂等请求需由调用方保证安全
129676
129679
 
@@ -129680,7 +129683,7 @@ JSON 解析失败或重试验证未通过后的重试次数,默认 0;仅适
129680
129683
 
129681
129684
  > `optional` **retryJsonHandler?**: (`json`) => `boolean`
129682
129685
 
129683
- Defined in: [lib/undici.ts:911](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L911)
129686
+ Defined in: [lib/undici.ts:880](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L880)
129684
129687
 
129685
129688
  JSON 重试验证方法;返回 false 时按 retryJson 的设置重试,耗尽后仍返回最后一次解析结果,业务结果由调用方判断;仅适用于 ResponseJson 快捷方法
129686
129689
 
@@ -129700,7 +129703,7 @@ JSON 重试验证方法;返回 false 时按 retryJson 的设置重试,耗尽
129700
129703
 
129701
129704
  > `optional` **reuse?**: `string` \| `Agent` \| `ProxyAgent`
129702
129705
 
129703
- Defined in: [lib/undici.ts:934](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L934)
129706
+ Defined in: [lib/undici.ts:903](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L903)
129704
129707
 
129705
129708
  复用池名/Agent,默认为 default
129706
129709
 
@@ -129710,7 +129713,7 @@ Defined in: [lib/undici.ts:934](https://github.com/maiyunnet/kebab/blob/master/l
129710
129713
 
129711
129714
  > `optional` **reuseTimeout?**: `number`
129712
129715
 
129713
- Defined in: [lib/undici.ts:932](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L932)
129716
+ Defined in: [lib/undici.ts:901](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L901)
129714
129717
 
129715
129718
  连接建立后允许承接新请求的最长秒数;非正数或无效值按未设置处理;达到后不再复用但不会中断在途请求,默认不限制;自定义 Agent 由其自身配置
129716
129719
 
@@ -129720,7 +129723,7 @@ Defined in: [lib/undici.ts:932](https://github.com/maiyunnet/kebab/blob/master/l
129720
129723
 
129721
129724
  > `optional` **save?**: `string`
129722
129725
 
129723
- Defined in: [lib/undici.ts:916](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L916)
129726
+ Defined in: [lib/undici.ts:885](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L885)
129724
129727
 
129725
129728
  ***
129726
129729
 
@@ -129728,7 +129731,7 @@ Defined in: [lib/undici.ts:916](https://github.com/maiyunnet/kebab/blob/master/l
129728
129731
 
129729
129732
  > `optional` **signal?**: `AbortSignal`
129730
129733
 
129731
- Defined in: [lib/undici.ts:940](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L940)
129734
+ Defined in: [lib/undici.ts:909](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L909)
129732
129735
 
129733
129736
  请求中止信号
129734
129737
 
@@ -129738,7 +129741,7 @@ Defined in: [lib/undici.ts:940](https://github.com/maiyunnet/kebab/blob/master/l
129738
129741
 
129739
129742
  > `optional` **timeout?**: `number`
129740
129743
 
129741
- Defined in: [lib/undici.ts:905](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L905)
129744
+ Defined in: [lib/undici.ts:874](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L874)
129742
129745
 
129743
129746
  秒数,默认 300 秒
129744
129747
 
@@ -129748,7 +129751,7 @@ Defined in: [lib/undici.ts:905](https://github.com/maiyunnet/kebab/blob/master/l
129748
129751
 
129749
129752
  > `optional` **type?**: `"form"` \| `"json"`
129750
129753
 
129751
- Defined in: [lib/undici.ts:903](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L903)
129754
+ Defined in: [lib/undici.ts:872](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L872)
129752
129755
 
129753
129756
  lib/undici/interfaces/IRproxyOptions.md
129754
129757
  ---
@@ -129761,17 +129764,21 @@ lib/undici/interfaces/IRproxyOptions.md
129761
129764
 
129762
129765
  # Interface: IRproxyOptions
129763
129766
 
129764
- Defined in: [lib/undici.ts:963](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L963)
129767
+ Defined in: [lib/undici.ts:934](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L934)
129765
129768
 
129766
129769
  反向代理请求的传入参数选项
129767
129770
 
129771
+ ## Extends
129772
+
129773
+ - [`IProxyHeaderOptions`](../proxy/interfaces/IProxyHeaderOptions.md)
129774
+
129768
129775
  ## Properties
129769
129776
 
129770
129777
  ### body?
129771
129778
 
129772
129779
  > `optional` **body?**: `string` \| `Buffer`\<`ArrayBufferLike`\> \| `Readable`
129773
129780
 
129774
- Defined in: [lib/undici.ts:986](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L986)
129781
+ Defined in: [lib/undici.ts:957](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L957)
129775
129782
 
129776
129783
  手动传入请求体(优先于原始 req 流),用于 req 流已消费后仍需转发 body 的场景
129777
129784
 
@@ -129781,7 +129788,7 @@ Defined in: [lib/undici.ts:986](https://github.com/maiyunnet/kebab/blob/master/l
129781
129788
 
129782
129789
  > `optional` **filter?**: (`h`) => `boolean`
129783
129790
 
129784
- Defined in: [lib/undici.ts:976](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L976)
129791
+ Defined in: [lib/undici.ts:947](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L947)
129785
129792
 
129786
129793
  过滤 header,返回 true 则留下
129787
129794
 
@@ -129801,7 +129808,7 @@ Defined in: [lib/undici.ts:976](https://github.com/maiyunnet/kebab/blob/master/l
129801
129808
 
129802
129809
  > `optional` **follow?**: `number`
129803
129810
 
129804
- Defined in: [lib/undici.ts:966](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L966)
129811
+ Defined in: [lib/undici.ts:937](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L937)
129805
129812
 
129806
129813
  ***
129807
129814
 
@@ -129809,7 +129816,7 @@ Defined in: [lib/undici.ts:966](https://github.com/maiyunnet/kebab/blob/master/l
129809
129816
 
129810
129817
  > `optional` **headers?**: [`THttpHeaders`](../type-aliases/THttpHeaders.md)
129811
129818
 
129812
- Defined in: [lib/undici.ts:970](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L970)
129819
+ Defined in: [lib/undici.ts:941](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L941)
129813
129820
 
129814
129821
  ***
129815
129822
 
@@ -129817,7 +129824,7 @@ Defined in: [lib/undici.ts:970](https://github.com/maiyunnet/kebab/blob/master/l
129817
129824
 
129818
129825
  > `optional` **hosts?**: `string` \| `Record`\<`string`, `string`\>
129819
129826
 
129820
- Defined in: [lib/undici.ts:968](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L968)
129827
+ Defined in: [lib/undici.ts:939](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L939)
129821
129828
 
129822
129829
  自定义 host 映射,如 {'www.maiyun.net': '127.0.0.1'},或全部映射到一个 host
129823
129830
 
@@ -129827,7 +129834,7 @@ Defined in: [lib/undici.ts:968](https://github.com/maiyunnet/kebab/blob/master/l
129827
129834
 
129828
129835
  > `optional` **keepAliveTimeout?**: `number`
129829
129836
 
129830
- Defined in: [lib/undici.ts:972](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L972)
129837
+ Defined in: [lib/undici.ts:943](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L943)
129831
129838
 
129832
129839
  空闲连接允许复用的最长秒数;非正数或无效值按未设置处理;默认无服务端提示时为 4 秒,有提示时采用提示值减 2 秒且最多 600 秒
129833
129840
 
@@ -129837,7 +129844,7 @@ Defined in: [lib/undici.ts:972](https://github.com/maiyunnet/kebab/blob/master/l
129837
129844
 
129838
129845
  > `optional` **local?**: `string`
129839
129846
 
129840
- Defined in: [lib/undici.ts:969](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L969)
129847
+ Defined in: [lib/undici.ts:940](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L940)
129841
129848
 
129842
129849
  ***
129843
129850
 
@@ -129845,7 +129852,7 @@ Defined in: [lib/undici.ts:969](https://github.com/maiyunnet/kebab/blob/master/l
129845
129852
 
129846
129853
  > `optional` **mproxy?**: `object`
129847
129854
 
129848
- Defined in: [lib/undici.ts:978](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L978)
129855
+ Defined in: [lib/undici.ts:949](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L949)
129849
129856
 
129850
129857
  正向 mproxy 代理,url 如 https://xxx/abc
129851
129858
 
@@ -129869,11 +129876,28 @@ Defined in: [lib/undici.ts:978](https://github.com/maiyunnet/kebab/blob/master/l
129869
129876
 
129870
129877
  ***
129871
129878
 
129879
+ ### proxyMode?
129880
+
129881
+ > `optional` **proxyMode?**: `"reverse"` \| `"request"` \| `"passthrough"`
129882
+
129883
+ Defined in: [lib/undici/proxy.ts:14](https://github.com/maiyunnet/kebab/blob/master/lib/undici/proxy.ts#L14)
129884
+
129885
+ 默认 passthrough 透传;request 使用目标 Host 并清理代理来源头;reverse 保留外部 Host 并生成来源头
129886
+ passthrough 使用目标 Host,保留通过基础过滤的来路头,不自动生成来源头。
129887
+ request/reverse 均清理传入的 Forwarded、X-Forwarded-*、Via、X-Real-IP 及 CDN 来源头。
129888
+ reverse 的协议和 IP 仅取实际连接,不信任来路代理头;可信代理信息由业务验证后通过 headers 覆盖。
129889
+
129890
+ #### Inherited from
129891
+
129892
+ [`IProxyHeaderOptions`](../proxy/interfaces/IProxyHeaderOptions.md).[`proxyMode`](../proxy/interfaces/IProxyHeaderOptions.md#proxymode)
129893
+
129894
+ ***
129895
+
129872
129896
  ### querys?
129873
129897
 
129874
129898
  > `optional` **querys?**: `Record`\<`string`, `any`\>
129875
129899
 
129876
- Defined in: [lib/undici.ts:988](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L988)
129900
+ Defined in: [lib/undici.ts:959](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L959)
129877
129901
 
129878
129902
  自定义 GET 查询参数,传入后直接替换代理目标 URL 的整个 query string
129879
129903
 
@@ -129883,7 +129907,7 @@ Defined in: [lib/undici.ts:988](https://github.com/maiyunnet/kebab/blob/master/l
129883
129907
 
129884
129908
  > `optional` **reuse?**: `string` \| `Agent` \| `ProxyAgent`
129885
129909
 
129886
- Defined in: [lib/undici.ts:990](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L990)
129910
+ Defined in: [lib/undici.ts:961](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L961)
129887
129911
 
129888
129912
  默认为 default
129889
129913
 
@@ -129893,7 +129917,7 @@ Defined in: [lib/undici.ts:990](https://github.com/maiyunnet/kebab/blob/master/l
129893
129917
 
129894
129918
  > `optional` **reuseTimeout?**: `number`
129895
129919
 
129896
- Defined in: [lib/undici.ts:974](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L974)
129920
+ Defined in: [lib/undici.ts:945](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L945)
129897
129921
 
129898
129922
  连接建立后允许承接新请求的最长秒数;非正数或无效值按未设置处理;达到后不再复用但不会中断在途请求,默认不限制
129899
129923
 
@@ -129903,10 +129927,148 @@ Defined in: [lib/undici.ts:974](https://github.com/maiyunnet/kebab/blob/master/l
129903
129927
 
129904
129928
  > `optional` **timeout?**: `number`
129905
129929
 
129906
- Defined in: [lib/undici.ts:965](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L965)
129930
+ Defined in: [lib/undici.ts:936](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L936)
129907
129931
 
129908
129932
  秒数,默认 300 秒
129909
129933
 
129934
+ lib/undici/proxy/index.md
129935
+ ---
129936
+
129937
+ [**Documents for @maiyunnet/kebab**](../../../index.md)
129938
+
129939
+ ***
129940
+
129941
+ [Documents for @maiyunnet/kebab](../../../index.md) / lib/undici/proxy
129942
+
129943
+ # lib/undici/proxy
129944
+
129945
+ ## Interfaces
129946
+
129947
+ - [IProxyHeaderOptions](interfaces/IProxyHeaderOptions.md)
129948
+
129949
+ ## Variables
129950
+
129951
+ - [filterProxyHeaders](variables/filterProxyHeaders.md)
129952
+ - [getProxyHeaders](variables/getProxyHeaders.md)
129953
+
129954
+ lib/undici/proxy/interfaces/IProxyHeaderOptions.md
129955
+ ---
129956
+
129957
+ [**Documents for @maiyunnet/kebab**](../../../../index.md)
129958
+
129959
+ ***
129960
+
129961
+ [Documents for @maiyunnet/kebab](../../../../index.md) / [lib/undici/proxy](../index.md) / IProxyHeaderOptions
129962
+
129963
+ # Interface: IProxyHeaderOptions
129964
+
129965
+ Defined in: [lib/undici/proxy.ts:7](https://github.com/maiyunnet/kebab/blob/master/lib/undici/proxy.ts#L7)
129966
+
129967
+ undici 和 ws 共用请求头模式,mproxy 仅支持 passthrough 和 request
129968
+
129969
+ ## Extended by
129970
+
129971
+ - [`IRproxyOptions`](../../interfaces/IRproxyOptions.md)
129972
+ - [`IRproxyOptions`](../../../ws/interfaces/IRproxyOptions.md)
129973
+
129974
+ ## Properties
129975
+
129976
+ ### proxyMode?
129977
+
129978
+ > `optional` **proxyMode?**: `"reverse"` \| `"request"` \| `"passthrough"`
129979
+
129980
+ Defined in: [lib/undici/proxy.ts:14](https://github.com/maiyunnet/kebab/blob/master/lib/undici/proxy.ts#L14)
129981
+
129982
+ 默认 passthrough 透传;request 使用目标 Host 并清理代理来源头;reverse 保留外部 Host 并生成来源头
129983
+ passthrough 使用目标 Host,保留通过基础过滤的来路头,不自动生成来源头。
129984
+ request/reverse 均清理传入的 Forwarded、X-Forwarded-*、Via、X-Real-IP 及 CDN 来源头。
129985
+ reverse 的协议和 IP 仅取实际连接,不信任来路代理头;可信代理信息由业务验证后通过 headers 覆盖。
129986
+
129987
+ lib/undici/proxy/variables/filterProxyHeaders.md
129988
+ ---
129989
+
129990
+ [**Documents for @maiyunnet/kebab**](../../../../index.md)
129991
+
129992
+ ***
129993
+
129994
+ [Documents for @maiyunnet/kebab](../../../../index.md) / [lib/undici/proxy](../index.md) / filterProxyHeaders
129995
+
129996
+ # Variable: filterProxyHeaders
129997
+
129998
+ > `const` **filterProxyHeaders**: (`headers`, `res?`, `filter?`) => `Record`\<`string`, `string` \| `string`[]\> = `filterProxyHeadersImpl`
129999
+
130000
+ Defined in: [lib/undici/proxy.ts:24](https://github.com/maiyunnet/kebab/blob/master/lib/undici/proxy.ts#L24)
130001
+
130002
+ 过滤代理请求或响应的基础头部,不处理来源信息
130003
+
130004
+ ## Parameters
130005
+
130006
+ ### headers
130007
+
130008
+ `http.IncomingHttpHeaders` \| `http2.IncomingHttpHeaders` \| [`THttpHeaders`](../../type-aliases/THttpHeaders.md)
130009
+
130010
+ 待过滤的头部
130011
+
130012
+ ### res?
130013
+
130014
+ `http2.Http2ServerResponse` \| `http.ServerResponse`
130015
+
130016
+ 传入时直接设置响应头并返回空对象,响应头已发送时不再写入
130017
+
130018
+ ### filter?
130019
+
130020
+ (`h`) => `boolean`
130021
+
130022
+ 业务过滤,返回 true 则保留
130023
+
130024
+ ## Returns
130025
+
130026
+ `Record`\<`string`, `string` \| `string`[]\>
130027
+
130028
+ 过滤后的头部,不修改输入
130029
+
130030
+ lib/undici/proxy/variables/getProxyHeaders.md
130031
+ ---
130032
+
130033
+ [**Documents for @maiyunnet/kebab**](../../../../index.md)
130034
+
130035
+ ***
130036
+
130037
+ [Documents for @maiyunnet/kebab](../../../../index.md) / [lib/undici/proxy](../index.md) / getProxyHeaders
130038
+
130039
+ # Variable: getProxyHeaders
130040
+
130041
+ > `const` **getProxyHeaders**: (`req`, `opt?`) => `http.IncomingHttpHeaders` = `buildProxyHeaders`
130042
+
130043
+ Defined in: [lib/undici/proxy.ts:41](https://github.com/maiyunnet/kebab/blob/master/lib/undici/proxy.ts#L41)
130044
+
130045
+ 构造上游请求头,依次执行基础过滤、业务 filter、模式处理及 headers 覆盖
130046
+ 保留 Cookie、Authorization、Origin、Referer 的业务语义,不保证请求无法被识别为代理。
130047
+ 来源头包括 Forwarded、Via、X-Real-IP、X-Forwarded-*、CF-*、EO-*、True-Client-IP、Client-IP、
130048
+ X-Client-IP、Fastly-Client-IP、X-Cluster-Client-IP、X-Envoy-External-Address、X-Original-Forwarded-For、
130049
+ X-Original-Host、X-Original-URL、X-Rewrite-URL;业务可通过 filter 补充过滤,headers 覆盖优先级最高。
130050
+ reverse 输出 Host、X-Forwarded-Host、X-Forwarded-Proto、X-Forwarded-For、X-Real-IP。
130051
+
130052
+ ## Parameters
130053
+
130054
+ ### req
130055
+
130056
+ `http.IncomingMessage` \| `http2.Http2ServerRequest`
130057
+
130058
+ 原始 HTTP 或 WebSocket 握手请求
130059
+
130060
+ ### opt?
130061
+
130062
+ [`IProxyHeaderOptions`](../interfaces/IProxyHeaderOptions.md) & `object`
130063
+
130064
+ 模式、业务过滤及显式覆盖的头部
130065
+
130066
+ ## Returns
130067
+
130068
+ `http.IncomingHttpHeaders`
130069
+
130070
+ 独立的上游请求头对象,不修改输入
130071
+
129910
130072
  lib/undici/request/classes/Request.md
129911
130073
  ---
129912
130074
 
@@ -130458,7 +130620,7 @@ lib/undici/type-aliases/THttpHeaders.md
130458
130620
 
130459
130621
  > **THttpHeaders** = `http.IncomingHttpHeaders` & `object`
130460
130622
 
130461
- Defined in: [lib/undici.ts:995](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L995)
130623
+ Defined in: [lib/undici.ts:966](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L966)
130462
130624
 
130463
130625
  http headers
130464
130626
 
@@ -130472,6 +130634,49 @@ http headers
130472
130634
 
130473
130635
  > `optional` **http-url?**: `string`
130474
130636
 
130637
+ lib/undici/variables/filterProxyHeaders.md
130638
+ ---
130639
+
130640
+ [**Documents for @maiyunnet/kebab**](../../../index.md)
130641
+
130642
+ ***
130643
+
130644
+ [Documents for @maiyunnet/kebab](../../../index.md) / [lib/undici](../index.md) / filterProxyHeaders
130645
+
130646
+ # Variable: filterProxyHeaders
130647
+
130648
+ > `const` **filterProxyHeaders**: (`headers`, `res?`, `filter?`) => `Record`\<`string`, `string` \| `string`[]\> = `lProxy.filterProxyHeaders`
130649
+
130650
+ Defined in: [lib/undici.ts:669](https://github.com/maiyunnet/kebab/blob/master/lib/undici.ts#L669)
130651
+
130652
+ 过滤代理请求或响应的基础头部,不生成或清理来源信息
130653
+
130654
+ ## Parameters
130655
+
130656
+ ### headers
130657
+
130658
+ `http.IncomingHttpHeaders` \| `http2.IncomingHttpHeaders` \| [`THttpHeaders`](../type-aliases/THttpHeaders.md)
130659
+
130660
+ 待过滤的头部
130661
+
130662
+ ### res?
130663
+
130664
+ `http2.Http2ServerResponse` \| `http.ServerResponse`
130665
+
130666
+ 传入时直接设置响应头并返回空对象,响应头已发送时不再写入
130667
+
130668
+ ### filter?
130669
+
130670
+ (`h`) => `boolean`
130671
+
130672
+ 业务过滤,返回 true 则保留
130673
+
130674
+ ## Returns
130675
+
130676
+ `Record`\<`string`, `string` \| `string`[]\>
130677
+
130678
+ 过滤后的头部,不修改输入
130679
+
130475
130680
  lib/vector/classes/Vector.md
130476
130681
  ---
130477
130682
 
@@ -130745,7 +130950,7 @@ lib/ws/classes/Socket.md
130745
130950
 
130746
130951
  # Class: Socket
130747
130952
 
130748
- Defined in: [lib/ws.ts:163](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L163)
130953
+ Defined in: [lib/ws.ts:166](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L166)
130749
130954
 
130750
130955
  ## Constructors
130751
130956
 
@@ -130753,7 +130958,7 @@ Defined in: [lib/ws.ts:163](https://github.com/maiyunnet/kebab/blob/master/lib/w
130753
130958
 
130754
130959
  > **new Socket**(`request?`, `socket?`, `head?`, `options?`): `Socket`
130755
130960
 
130756
- Defined in: [lib/ws.ts:192](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L192)
130961
+ Defined in: [lib/ws.ts:195](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L195)
130757
130962
 
130758
130963
  #### Parameters
130759
130964
 
@@ -130791,7 +130996,7 @@ Defined in: [lib/ws.ts:192](https://github.com/maiyunnet/kebab/blob/master/lib/w
130791
130996
 
130792
130997
  > **get** **ended**(): `boolean`
130793
130998
 
130794
- Defined in: [lib/ws.ts:664](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L664)
130999
+ Defined in: [lib/ws.ts:667](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L667)
130795
131000
 
130796
131001
  当前是否已经结束读取,并且无法继续读取
130797
131002
 
@@ -130807,7 +131012,7 @@ Defined in: [lib/ws.ts:664](https://github.com/maiyunnet/kebab/blob/master/lib/w
130807
131012
 
130808
131013
  > **get** **finished**(): `boolean`
130809
131014
 
130810
- Defined in: [lib/ws.ts:669](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L669)
131015
+ Defined in: [lib/ws.ts:672](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L672)
130811
131016
 
130812
131017
  当前是否已经结束写入,并且无法继续写入
130813
131018
 
@@ -130823,7 +131028,7 @@ Defined in: [lib/ws.ts:669](https://github.com/maiyunnet/kebab/blob/master/lib/w
130823
131028
 
130824
131029
  > **get** **isServer**(): `boolean`
130825
131030
 
130826
- Defined in: [lib/ws.ts:676](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L676)
131031
+ Defined in: [lib/ws.ts:679](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L679)
130827
131032
 
130828
131033
  当前连接是不是服务器连接
130829
131034
 
@@ -130839,7 +131044,7 @@ Defined in: [lib/ws.ts:676](https://github.com/maiyunnet/kebab/blob/master/lib/w
130839
131044
 
130840
131045
  > **get** **writable**(): `boolean`
130841
131046
 
130842
- Defined in: [lib/ws.ts:659](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L659)
131047
+ Defined in: [lib/ws.ts:662](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L662)
130843
131048
 
130844
131049
  当前是否是可写状态
130845
131050
 
@@ -130853,7 +131058,7 @@ Defined in: [lib/ws.ts:659](https://github.com/maiyunnet/kebab/blob/master/lib/w
130853
131058
 
130854
131059
  > **connect**(`u`, `opt?`): `Promise`\<`Socket` \| `null`\>
130855
131060
 
130856
- Defined in: [lib/ws.ts:225](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L225)
131061
+ Defined in: [lib/ws.ts:228](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L228)
130857
131062
 
130858
131063
  以客户端形式发起链接
130859
131064
 
@@ -130881,7 +131086,7 @@ Defined in: [lib/ws.ts:225](https://github.com/maiyunnet/kebab/blob/master/lib/w
130881
131086
 
130882
131087
  > **destroy**(): `void`
130883
131088
 
130884
- Defined in: [lib/ws.ts:576](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L576)
131089
+ Defined in: [lib/ws.ts:579](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L579)
130885
131090
 
130886
131091
  #### Returns
130887
131092
 
@@ -130893,7 +131098,7 @@ Defined in: [lib/ws.ts:576](https://github.com/maiyunnet/kebab/blob/master/lib/w
130893
131098
 
130894
131099
  > **end**(`code?`, `reason?`): `void`
130895
131100
 
130896
- Defined in: [lib/ws.ts:568](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L568)
131101
+ Defined in: [lib/ws.ts:571](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L571)
130897
131102
 
130898
131103
  正常结束 WebSocket 连接
130899
131104
 
@@ -130921,7 +131126,7 @@ WebSocket 关闭码
130921
131126
 
130922
131127
  > **off**(`event`): `this`
130923
131128
 
130924
- Defined in: [lib/ws.ts:558](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L558)
131129
+ Defined in: [lib/ws.ts:561](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L561)
130925
131130
 
130926
131131
  取消监听
130927
131132
 
@@ -130943,7 +131148,7 @@ Defined in: [lib/ws.ts:558](https://github.com/maiyunnet/kebab/blob/master/lib/w
130943
131148
 
130944
131149
  > **on**(`event`, `cb`): `this`
130945
131150
 
130946
- Defined in: [lib/ws.ts:512](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L512)
131151
+ Defined in: [lib/ws.ts:515](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L515)
130947
131152
 
130948
131153
  绑定监听
130949
131154
 
@@ -130965,7 +131170,7 @@ Defined in: [lib/ws.ts:512](https://github.com/maiyunnet/kebab/blob/master/lib/w
130965
131170
 
130966
131171
  > **on**(`event`, `cb`): `this`
130967
131172
 
130968
- Defined in: [lib/ws.ts:516](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L516)
131173
+ Defined in: [lib/ws.ts:519](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L519)
130969
131174
 
130970
131175
  绑定监听
130971
131176
 
@@ -130987,7 +131192,7 @@ Defined in: [lib/ws.ts:516](https://github.com/maiyunnet/kebab/blob/master/lib/w
130987
131192
 
130988
131193
  > **on**(`event`, `cb`): `this`
130989
131194
 
130990
- Defined in: [lib/ws.ts:517](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L517)
131195
+ Defined in: [lib/ws.ts:520](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L520)
130991
131196
 
130992
131197
  绑定监听
130993
131198
 
@@ -131009,7 +131214,7 @@ Defined in: [lib/ws.ts:517](https://github.com/maiyunnet/kebab/blob/master/lib/w
131009
131214
 
131010
131215
  > **on**(`event`, `cb`): `this`
131011
131216
 
131012
- Defined in: [lib/ws.ts:518](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L518)
131217
+ Defined in: [lib/ws.ts:521](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L521)
131013
131218
 
131014
131219
  绑定监听
131015
131220
 
@@ -131033,7 +131238,7 @@ Defined in: [lib/ws.ts:518](https://github.com/maiyunnet/kebab/blob/master/lib/w
131033
131238
 
131034
131239
  > **pause**(): `void`
131035
131240
 
131036
- Defined in: [lib/ws.ts:582](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L582)
131241
+ Defined in: [lib/ws.ts:585](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L585)
131037
131242
 
131038
131243
  暂停向消息监听器派发数据,并暂停底层 TCP 读取
131039
131244
 
@@ -131047,7 +131252,7 @@ Defined in: [lib/ws.ts:582](https://github.com/maiyunnet/kebab/blob/master/lib/w
131047
131252
 
131048
131253
  > **ping**(`data?`): `boolean`
131049
131254
 
131050
- Defined in: [lib/ws.ts:681](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L681)
131255
+ Defined in: [lib/ws.ts:684](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L684)
131051
131256
 
131052
131257
  发送 ping
131053
131258
 
@@ -131067,7 +131272,7 @@ Defined in: [lib/ws.ts:681](https://github.com/maiyunnet/kebab/blob/master/lib/w
131067
131272
 
131068
131273
  > **pong**(`data?`): `boolean`
131069
131274
 
131070
- Defined in: [lib/ws.ts:686](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L686)
131275
+ Defined in: [lib/ws.ts:689](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L689)
131071
131276
 
131072
131277
  发送 ping
131073
131278
 
@@ -131087,7 +131292,7 @@ Defined in: [lib/ws.ts:686](https://github.com/maiyunnet/kebab/blob/master/lib/w
131087
131292
 
131088
131293
  > **resume**(): `void`
131089
131294
 
131090
- Defined in: [lib/ws.ts:588](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L588)
131295
+ Defined in: [lib/ws.ts:591](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L591)
131091
131296
 
131092
131297
  恢复派发缓存消息,并恢复底层 TCP 读取
131093
131298
 
@@ -131101,7 +131306,7 @@ Defined in: [lib/ws.ts:588](https://github.com/maiyunnet/kebab/blob/master/lib/w
131101
131306
 
131102
131307
  > **writeBinary**(`data`): `boolean`
131103
131308
 
131104
- Defined in: [lib/ws.ts:607](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L607)
131309
+ Defined in: [lib/ws.ts:610](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L610)
131105
131310
 
131106
131311
  发送二进制
131107
131312
 
@@ -131121,7 +131326,7 @@ Defined in: [lib/ws.ts:607](https://github.com/maiyunnet/kebab/blob/master/lib/w
131121
131326
 
131122
131327
  > **writeResult**(`data`): `boolean`
131123
131328
 
131124
- Defined in: [lib/ws.ts:602](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L602)
131329
+ Defined in: [lib/ws.ts:605](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L605)
131125
131330
 
131126
131331
  发送结果对象字符串
131127
131332
 
@@ -131141,7 +131346,7 @@ Defined in: [lib/ws.ts:602](https://github.com/maiyunnet/kebab/blob/master/lib/w
131141
131346
 
131142
131347
  > **writeText**(`data`): `boolean`
131143
131348
 
131144
- Defined in: [lib/ws.ts:597](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L597)
131349
+ Defined in: [lib/ws.ts:600](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L600)
131145
131350
 
131146
131351
  发送文本
131147
131352
 
@@ -131166,7 +131371,7 @@ lib/ws/enumerations/EFrameReceiveMode.md
131166
131371
 
131167
131372
  # Enumeration: EFrameReceiveMode
131168
131373
 
131169
- Defined in: [lib/ws.ts:19](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L19)
131374
+ Defined in: [lib/ws.ts:20](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L20)
131170
131375
 
131171
131376
  一般用 SIMPLE
131172
131377
 
@@ -131176,7 +131381,7 @@ Defined in: [lib/ws.ts:19](https://github.com/maiyunnet/kebab/blob/master/lib/ws
131176
131381
 
131177
131382
  > **LITE**: `1`
131178
131383
 
131179
- Defined in: [lib/ws.ts:21](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L21)
131384
+ Defined in: [lib/ws.ts:22](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L22)
131180
131385
 
131181
131386
  ***
131182
131387
 
@@ -131184,7 +131389,7 @@ Defined in: [lib/ws.ts:21](https://github.com/maiyunnet/kebab/blob/master/lib/ws
131184
131389
 
131185
131390
  > **SIMPLE**: `2`
131186
131391
 
131187
- Defined in: [lib/ws.ts:22](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L22)
131392
+ Defined in: [lib/ws.ts:23](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L23)
131188
131393
 
131189
131394
  ***
131190
131395
 
@@ -131192,7 +131397,7 @@ Defined in: [lib/ws.ts:22](https://github.com/maiyunnet/kebab/blob/master/lib/ws
131192
131397
 
131193
131398
  > **STANDARD**: `0`
131194
131399
 
131195
- Defined in: [lib/ws.ts:20](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L20)
131400
+ Defined in: [lib/ws.ts:21](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L21)
131196
131401
 
131197
131402
  lib/ws/enumerations/EOpcode.md
131198
131403
  ---
@@ -131205,7 +131410,7 @@ lib/ws/enumerations/EOpcode.md
131205
131410
 
131206
131411
  # Enumeration: EOpcode
131207
131412
 
131208
- Defined in: [lib/ws.ts:26](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L26)
131413
+ Defined in: [lib/ws.ts:27](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L27)
131209
131414
 
131210
131415
  OPCODE
131211
131416
 
@@ -131215,7 +131420,7 @@ OPCODE
131215
131420
 
131216
131421
  > **BINARY**: `2`
131217
131422
 
131218
- Defined in: [lib/ws.ts:29](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L29)
131423
+ Defined in: [lib/ws.ts:30](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L30)
131219
131424
 
131220
131425
  ***
131221
131426
 
@@ -131223,7 +131428,7 @@ Defined in: [lib/ws.ts:29](https://github.com/maiyunnet/kebab/blob/master/lib/ws
131223
131428
 
131224
131429
  > **CLOSE**: `8`
131225
131430
 
131226
- Defined in: [lib/ws.ts:30](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L30)
131431
+ Defined in: [lib/ws.ts:31](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L31)
131227
131432
 
131228
131433
  ***
131229
131434
 
@@ -131231,7 +131436,7 @@ Defined in: [lib/ws.ts:30](https://github.com/maiyunnet/kebab/blob/master/lib/ws
131231
131436
 
131232
131437
  > **CONTINUATION**: `0`
131233
131438
 
131234
- Defined in: [lib/ws.ts:27](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L27)
131439
+ Defined in: [lib/ws.ts:28](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L28)
131235
131440
 
131236
131441
  ***
131237
131442
 
@@ -131239,7 +131444,7 @@ Defined in: [lib/ws.ts:27](https://github.com/maiyunnet/kebab/blob/master/lib/ws
131239
131444
 
131240
131445
  > **PING**: `9`
131241
131446
 
131242
- Defined in: [lib/ws.ts:31](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L31)
131447
+ Defined in: [lib/ws.ts:32](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L32)
131243
131448
 
131244
131449
  ***
131245
131450
 
@@ -131247,7 +131452,7 @@ Defined in: [lib/ws.ts:31](https://github.com/maiyunnet/kebab/blob/master/lib/ws
131247
131452
 
131248
131453
  > **PONG**: `10`
131249
131454
 
131250
- Defined in: [lib/ws.ts:32](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L32)
131455
+ Defined in: [lib/ws.ts:33](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L33)
131251
131456
 
131252
131457
  ***
131253
131458
 
@@ -131255,7 +131460,7 @@ Defined in: [lib/ws.ts:32](https://github.com/maiyunnet/kebab/blob/master/lib/ws
131255
131460
 
131256
131461
  > **TEXT**: `1`
131257
131462
 
131258
- Defined in: [lib/ws.ts:28](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L28)
131463
+ Defined in: [lib/ws.ts:29](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L29)
131259
131464
 
131260
131465
  lib/ws/functions/connect.md
131261
131466
  ---
@@ -131270,7 +131475,7 @@ lib/ws/functions/connect.md
131270
131475
 
131271
131476
  > **connect**(`u`, `opt?`): `Promise`\<[`Socket`](../classes/Socket.md) \| `null`\>
131272
131477
 
131273
- Defined in: [lib/ws.ts:729](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L729)
131478
+ Defined in: [lib/ws.ts:732](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L732)
131274
131479
 
131275
131480
  创建一个 ws 客户端发起 ws 请求
131276
131481
 
@@ -131305,7 +131510,7 @@ lib/ws/functions/createServer.md
131305
131510
 
131306
131511
  > **createServer**(`request`, `socket`, `head?`, `options?`): [`Socket`](../classes/Socket.md)
131307
131512
 
131308
- Defined in: [lib/ws.ts:739](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L739)
131513
+ Defined in: [lib/ws.ts:742](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L742)
131309
131514
 
131310
131515
  创建一个 ws 服务器接收处理器
131311
131516
 
@@ -131354,7 +131559,7 @@ lib/ws/functions/mproxy.md
131354
131559
 
131355
131560
  > **mproxy**(`ctr`, `auth`, `opt?`): `Promise`\<`number`\>
131356
131561
 
131357
- Defined in: [lib/ws.ts:965](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L965)
131562
+ Defined in: [lib/ws.ts:968](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L968)
131358
131563
 
131359
131564
  正向 mproxy 代理,读取 get 的 url 为实际请求地址
131360
131565
  get: url, auth
@@ -131396,7 +131601,7 @@ lib/ws/functions/rproxy.md
131396
131601
 
131397
131602
  > **rproxy**(`ctr`, `url`, `opt?`): `Promise`\<`boolean`\>
131398
131603
 
131399
- Defined in: [lib/ws.ts:1002](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L1002)
131604
+ Defined in: [lib/ws.ts:1005](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L1005)
131400
131605
 
131401
131606
  反向代理,将本 socket 连接反代到其他网址,在 ws 的 onLoad 事件中使用
131402
131607
 
@@ -131437,7 +131642,7 @@ lib/ws/functions/rsocket.md
131437
131642
 
131438
131643
  > **rsocket**(`ctr`, `host`, `port`): `Promise`\<`boolean`\>
131439
131644
 
131440
- Defined in: [lib/ws.ts:1048](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L1048)
131645
+ Defined in: [lib/ws.ts:1051](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L1051)
131441
131646
 
131442
131647
  反向代理,将本 websocket 连接反代到其他真正的 socket,在 ws 的 onLoad 事件中使用
131443
131648
 
@@ -131517,7 +131722,7 @@ lib/ws/interfaces/IConnectOptions.md
131517
131722
 
131518
131723
  # Interface: IConnectOptions
131519
131724
 
131520
- Defined in: [lib/ws.ts:36](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L36)
131725
+ Defined in: [lib/ws.ts:37](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L37)
131521
131726
 
131522
131727
  请求的传入参数选项
131523
131728
 
@@ -131527,7 +131732,7 @@ Defined in: [lib/ws.ts:36](https://github.com/maiyunnet/kebab/blob/master/lib/ws
131527
131732
 
131528
131733
  > `optional` **cookie?**: `Record`\<`string`, [`ICookie`](../../cookie/interfaces/ICookie.md)\>
131529
131734
 
131530
- Defined in: [lib/ws.ts:44](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L44)
131735
+ Defined in: [lib/ws.ts:45](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L45)
131531
131736
 
131532
131737
  cookie 托管对象
131533
131738
 
@@ -131537,7 +131742,7 @@ cookie 托管对象
131537
131742
 
131538
131743
  > `optional` **headers?**: [`THttpHeaders`](../../undici/type-aliases/THttpHeaders.md)
131539
131744
 
131540
- Defined in: [lib/ws.ts:42](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L42)
131745
+ Defined in: [lib/ws.ts:43](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L43)
131541
131746
 
131542
131747
  ***
131543
131748
 
@@ -131545,7 +131750,7 @@ Defined in: [lib/ws.ts:42](https://github.com/maiyunnet/kebab/blob/master/lib/ws
131545
131750
 
131546
131751
  > `optional` **hosts?**: `string` \| `Record`\<`string`, `string`\>
131547
131752
 
131548
- Defined in: [lib/ws.ts:40](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L40)
131753
+ Defined in: [lib/ws.ts:41](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L41)
131549
131754
 
131550
131755
  自定义 host 映射,如 {'www.maiyun.net': '127.0.0.1'},或全部映射到一个 host
131551
131756
 
@@ -131555,7 +131760,7 @@ Defined in: [lib/ws.ts:40](https://github.com/maiyunnet/kebab/blob/master/lib/ws
131555
131760
 
131556
131761
  > `optional` **local?**: `string`
131557
131762
 
131558
- Defined in: [lib/ws.ts:41](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L41)
131763
+ Defined in: [lib/ws.ts:42](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L42)
131559
131764
 
131560
131765
  ***
131561
131766
 
@@ -131563,7 +131768,7 @@ Defined in: [lib/ws.ts:41](https://github.com/maiyunnet/kebab/blob/master/lib/ws
131563
131768
 
131564
131769
  > `optional` **masking?**: `boolean`
131565
131770
 
131566
- Defined in: [lib/ws.ts:48](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L48)
131771
+ Defined in: [lib/ws.ts:49](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L49)
131567
131772
 
131568
131773
  加密模式,默认 true
131569
131774
 
@@ -131573,7 +131778,7 @@ Defined in: [lib/ws.ts:48](https://github.com/maiyunnet/kebab/blob/master/lib/ws
131573
131778
 
131574
131779
  > `optional` **mode?**: [`EFrameReceiveMode`](../enumerations/EFrameReceiveMode.md)
131575
131780
 
131576
- Defined in: [lib/ws.ts:46](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L46)
131781
+ Defined in: [lib/ws.ts:47](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L47)
131577
131782
 
131578
131783
  小帧模式,默认 false
131579
131784
 
@@ -131583,7 +131788,7 @@ Defined in: [lib/ws.ts:46](https://github.com/maiyunnet/kebab/blob/master/lib/ws
131583
131788
 
131584
131789
  > `optional` **mproxy?**: `object`
131585
131790
 
131586
- Defined in: [lib/ws.ts:50](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L50)
131791
+ Defined in: [lib/ws.ts:51](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L51)
131587
131792
 
131588
131793
  正向 mproxy 代理,url 如 wss://xxx/abc
131589
131794
 
@@ -131601,7 +131806,7 @@ Defined in: [lib/ws.ts:50](https://github.com/maiyunnet/kebab/blob/master/lib/ws
131601
131806
 
131602
131807
  > `optional` **onConnectError?**: (`error`) => `void`
131603
131808
 
131604
- Defined in: [lib/ws.ts:55](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L55)
131809
+ Defined in: [lib/ws.ts:56](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L56)
131605
131810
 
131606
131811
  WebSocket 握手失败回调
131607
131812
 
@@ -131621,7 +131826,7 @@ WebSocket 握手失败回调
131621
131826
 
131622
131827
  > `optional` **timeout?**: `number`
131623
131828
 
131624
- Defined in: [lib/ws.ts:38](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L38)
131829
+ Defined in: [lib/ws.ts:39](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L39)
131625
131830
 
131626
131831
  秒数
131627
131832
 
@@ -131636,7 +131841,7 @@ lib/ws/interfaces/IMproxyOptions.md
131636
131841
 
131637
131842
  # Interface: IMproxyOptions
131638
131843
 
131639
- Defined in: [lib/ws.ts:80](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L80)
131844
+ Defined in: [lib/ws.ts:81](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L81)
131640
131845
 
131641
131846
  正向代理请求的传入参数选项
131642
131847
 
@@ -131646,7 +131851,7 @@ Defined in: [lib/ws.ts:80](https://github.com/maiyunnet/kebab/blob/master/lib/ws
131646
131851
 
131647
131852
  > `optional` **filter?**: (`h`) => `boolean`
131648
131853
 
131649
- Defined in: [lib/ws.ts:88](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L88)
131854
+ Defined in: [lib/ws.ts:91](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L91)
131650
131855
 
131651
131856
  过滤 header,返回 true 则留下
131652
131857
 
@@ -131666,7 +131871,7 @@ Defined in: [lib/ws.ts:88](https://github.com/maiyunnet/kebab/blob/master/lib/ws
131666
131871
 
131667
131872
  > `optional` **headers?**: [`THttpHeaders`](../../undici/type-aliases/THttpHeaders.md)
131668
131873
 
131669
- Defined in: [lib/ws.ts:86](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L86)
131874
+ Defined in: [lib/ws.ts:89](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L89)
131670
131875
 
131671
131876
  ***
131672
131877
 
@@ -131674,7 +131879,7 @@ Defined in: [lib/ws.ts:86](https://github.com/maiyunnet/kebab/blob/master/lib/ws
131674
131879
 
131675
131880
  > `optional` **hosts?**: `string` \| `Record`\<`string`, `string`\>
131676
131881
 
131677
- Defined in: [lib/ws.ts:84](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L84)
131882
+ Defined in: [lib/ws.ts:87](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L87)
131678
131883
 
131679
131884
  自定义 host 映射,如 {'www.maiyun.net': '127.0.0.1'},或全部映射到一个 host
131680
131885
 
@@ -131684,7 +131889,7 @@ Defined in: [lib/ws.ts:84](https://github.com/maiyunnet/kebab/blob/master/lib/ws
131684
131889
 
131685
131890
  > `optional` **local?**: `string`
131686
131891
 
131687
- Defined in: [lib/ws.ts:85](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L85)
131892
+ Defined in: [lib/ws.ts:88](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L88)
131688
131893
 
131689
131894
  ***
131690
131895
 
@@ -131692,7 +131897,7 @@ Defined in: [lib/ws.ts:85](https://github.com/maiyunnet/kebab/blob/master/lib/ws
131692
131897
 
131693
131898
  > `optional` **masking?**: `boolean`
131694
131899
 
131695
- Defined in: [lib/ws.ts:92](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L92)
131900
+ Defined in: [lib/ws.ts:95](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L95)
131696
131901
 
131697
131902
  加密模式,默认 true
131698
131903
 
@@ -131702,17 +131907,27 @@ Defined in: [lib/ws.ts:92](https://github.com/maiyunnet/kebab/blob/master/lib/ws
131702
131907
 
131703
131908
  > `optional` **mode?**: [`EFrameReceiveMode`](../enumerations/EFrameReceiveMode.md)
131704
131909
 
131705
- Defined in: [lib/ws.ts:90](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L90)
131910
+ Defined in: [lib/ws.ts:93](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L93)
131706
131911
 
131707
131912
  小帧模式,默认 false
131708
131913
 
131709
131914
  ***
131710
131915
 
131916
+ ### proxyMode?
131917
+
131918
+ > `optional` **proxyMode?**: `"request"` \| `"passthrough"`
131919
+
131920
+ Defined in: [lib/ws.ts:83](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L83)
131921
+
131922
+ 默认 passthrough 保留已有来源头;request 清理来源头;两者均使用目标 Host
131923
+
131924
+ ***
131925
+
131711
131926
  ### timeout?
131712
131927
 
131713
131928
  > `optional` **timeout?**: `number`
131714
131929
 
131715
- Defined in: [lib/ws.ts:82](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L82)
131930
+ Defined in: [lib/ws.ts:85](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L85)
131716
131931
 
131717
131932
  秒数
131718
131933
 
@@ -131727,7 +131942,7 @@ lib/ws/interfaces/IPipeCloseInfo.md
131727
131942
 
131728
131943
  # Interface: IPipeCloseInfo
131729
131944
 
131730
- Defined in: [lib/ws.ts:65](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L65)
131945
+ Defined in: [lib/ws.ts:66](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L66)
131731
131946
 
131732
131947
  WebSocket 管道关闭信息
131733
131948
 
@@ -131737,7 +131952,7 @@ WebSocket 管道关闭信息
131737
131952
 
131738
131953
  > `optional` **code?**: `number`
131739
131954
 
131740
- Defined in: [lib/ws.ts:69](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L69)
131955
+ Defined in: [lib/ws.ts:70](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L70)
131741
131956
 
131742
131957
  ***
131743
131958
 
@@ -131745,7 +131960,7 @@ Defined in: [lib/ws.ts:69](https://github.com/maiyunnet/kebab/blob/master/lib/ws
131745
131960
 
131746
131961
  > `optional` **error?**: `unknown`
131747
131962
 
131748
- Defined in: [lib/ws.ts:68](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L68)
131963
+ Defined in: [lib/ws.ts:69](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L69)
131749
131964
 
131750
131965
  ***
131751
131966
 
@@ -131753,7 +131968,7 @@ Defined in: [lib/ws.ts:68](https://github.com/maiyunnet/kebab/blob/master/lib/ws
131753
131968
 
131754
131969
  > **event**: [`TPipeCloseEvent`](../type-aliases/TPipeCloseEvent.md)
131755
131970
 
131756
- Defined in: [lib/ws.ts:67](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L67)
131971
+ Defined in: [lib/ws.ts:68](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L68)
131757
131972
 
131758
131973
  ***
131759
131974
 
@@ -131761,7 +131976,7 @@ Defined in: [lib/ws.ts:67](https://github.com/maiyunnet/kebab/blob/master/lib/ws
131761
131976
 
131762
131977
  > `optional` **reason?**: `string`
131763
131978
 
131764
- Defined in: [lib/ws.ts:70](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L70)
131979
+ Defined in: [lib/ws.ts:71](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L71)
131765
131980
 
131766
131981
  ***
131767
131982
 
@@ -131769,7 +131984,7 @@ Defined in: [lib/ws.ts:70](https://github.com/maiyunnet/kebab/blob/master/lib/ws
131769
131984
 
131770
131985
  > **side**: [`TPipeSide`](../type-aliases/TPipeSide.md)
131771
131986
 
131772
- Defined in: [lib/ws.ts:66](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L66)
131987
+ Defined in: [lib/ws.ts:67](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L67)
131773
131988
 
131774
131989
  lib/ws/interfaces/IRproxyOptions.md
131775
131990
  ---
@@ -131782,17 +131997,21 @@ lib/ws/interfaces/IRproxyOptions.md
131782
131997
 
131783
131998
  # Interface: IRproxyOptions
131784
131999
 
131785
- Defined in: [lib/ws.ts:96](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L96)
132000
+ Defined in: [lib/ws.ts:99](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L99)
131786
132001
 
131787
132002
  反向代理请求的传入参数选项
131788
132003
 
132004
+ ## Extends
132005
+
132006
+ - [`IProxyHeaderOptions`](../../undici/proxy/interfaces/IProxyHeaderOptions.md)
132007
+
131789
132008
  ## Properties
131790
132009
 
131791
132010
  ### closeReason?
131792
132011
 
131793
132012
  > `optional` **closeReason?**: (`info`) => `string`
131794
132013
 
131795
- Defined in: [lib/ws.ts:119](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L119)
132014
+ Defined in: [lib/ws.ts:122](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L122)
131796
132015
 
131797
132016
  生成回传给另一侧的 WebSocket 关闭原因,仅在管道断开时调用
131798
132017
 
@@ -131812,7 +132031,7 @@ Defined in: [lib/ws.ts:119](https://github.com/maiyunnet/kebab/blob/master/lib/w
131812
132031
 
131813
132032
  > `optional` **filter?**: (`h`) => `boolean`
131814
132033
 
131815
- Defined in: [lib/ws.ts:104](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L104)
132034
+ Defined in: [lib/ws.ts:107](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L107)
131816
132035
 
131817
132036
  过滤 header,返回 true 则留下
131818
132037
 
@@ -131832,7 +132051,7 @@ Defined in: [lib/ws.ts:104](https://github.com/maiyunnet/kebab/blob/master/lib/w
131832
132051
 
131833
132052
  > `optional` **headers?**: [`THttpHeaders`](../../undici/type-aliases/THttpHeaders.md)
131834
132053
 
131835
- Defined in: [lib/ws.ts:102](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L102)
132054
+ Defined in: [lib/ws.ts:105](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L105)
131836
132055
 
131837
132056
  ***
131838
132057
 
@@ -131840,7 +132059,7 @@ Defined in: [lib/ws.ts:102](https://github.com/maiyunnet/kebab/blob/master/lib/w
131840
132059
 
131841
132060
  > `optional` **hosts?**: `string` \| `Record`\<`string`, `string`\>
131842
132061
 
131843
- Defined in: [lib/ws.ts:100](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L100)
132062
+ Defined in: [lib/ws.ts:103](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L103)
131844
132063
 
131845
132064
  自定义 host 映射,如 {'www.maiyun.net': '127.0.0.1'},或全部映射到一个 host
131846
132065
 
@@ -131850,7 +132069,7 @@ Defined in: [lib/ws.ts:100](https://github.com/maiyunnet/kebab/blob/master/lib/w
131850
132069
 
131851
132070
  > `optional` **local?**: `string`
131852
132071
 
131853
- Defined in: [lib/ws.ts:101](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L101)
132072
+ Defined in: [lib/ws.ts:104](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L104)
131854
132073
 
131855
132074
  ***
131856
132075
 
@@ -131858,7 +132077,7 @@ Defined in: [lib/ws.ts:101](https://github.com/maiyunnet/kebab/blob/master/lib/w
131858
132077
 
131859
132078
  > `optional` **masking?**: `boolean`
131860
132079
 
131861
- Defined in: [lib/ws.ts:108](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L108)
132080
+ Defined in: [lib/ws.ts:111](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L111)
131862
132081
 
131863
132082
  加密模式,默认 true
131864
132083
 
@@ -131868,7 +132087,7 @@ Defined in: [lib/ws.ts:108](https://github.com/maiyunnet/kebab/blob/master/lib/w
131868
132087
 
131869
132088
  > `optional` **mode?**: [`EFrameReceiveMode`](../enumerations/EFrameReceiveMode.md)
131870
132089
 
131871
- Defined in: [lib/ws.ts:106](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L106)
132090
+ Defined in: [lib/ws.ts:109](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L109)
131872
132091
 
131873
132092
  小帧模式,默认 false
131874
132093
 
@@ -131878,7 +132097,7 @@ Defined in: [lib/ws.ts:106](https://github.com/maiyunnet/kebab/blob/master/lib/w
131878
132097
 
131879
132098
  > `optional` **mproxy?**: `object`
131880
132099
 
131881
- Defined in: [lib/ws.ts:110](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L110)
132100
+ Defined in: [lib/ws.ts:113](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L113)
131882
132101
 
131883
132102
  正向 mproxy 代理,url 如 wss://xxx/abc
131884
132103
 
@@ -131896,7 +132115,7 @@ Defined in: [lib/ws.ts:110](https://github.com/maiyunnet/kebab/blob/master/lib/w
131896
132115
 
131897
132116
  > `optional` **onClose?**: (`info`) => `void`
131898
132117
 
131899
- Defined in: [lib/ws.ts:117](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L117)
132118
+ Defined in: [lib/ws.ts:120](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L120)
131900
132119
 
131901
132120
  管道关闭回调,返回首先关闭的一侧及其底层事件
131902
132121
 
@@ -131916,7 +132135,7 @@ Defined in: [lib/ws.ts:117](https://github.com/maiyunnet/kebab/blob/master/lib/w
131916
132135
 
131917
132136
  > `optional` **onConnectError?**: (`error`) => `void`
131918
132137
 
131919
- Defined in: [lib/ws.ts:115](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L115)
132138
+ Defined in: [lib/ws.ts:118](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L118)
131920
132139
 
131921
132140
  连接目标 WebSocket 失败回调
131922
132141
 
@@ -131932,11 +132151,28 @@ Defined in: [lib/ws.ts:115](https://github.com/maiyunnet/kebab/blob/master/lib/w
131932
132151
 
131933
132152
  ***
131934
132153
 
132154
+ ### proxyMode?
132155
+
132156
+ > `optional` **proxyMode?**: `"reverse"` \| `"request"` \| `"passthrough"`
132157
+
132158
+ Defined in: [lib/undici/proxy.ts:14](https://github.com/maiyunnet/kebab/blob/master/lib/undici/proxy.ts#L14)
132159
+
132160
+ 默认 passthrough 透传;request 使用目标 Host 并清理代理来源头;reverse 保留外部 Host 并生成来源头
132161
+ passthrough 使用目标 Host,保留通过基础过滤的来路头,不自动生成来源头。
132162
+ request/reverse 均清理传入的 Forwarded、X-Forwarded-*、Via、X-Real-IP 及 CDN 来源头。
132163
+ reverse 的协议和 IP 仅取实际连接,不信任来路代理头;可信代理信息由业务验证后通过 headers 覆盖。
132164
+
132165
+ #### Inherited from
132166
+
132167
+ [`IProxyHeaderOptions`](../../undici/proxy/interfaces/IProxyHeaderOptions.md).[`proxyMode`](../../undici/proxy/interfaces/IProxyHeaderOptions.md#proxymode)
132168
+
132169
+ ***
132170
+
131935
132171
  ### timeout?
131936
132172
 
131937
132173
  > `optional` **timeout?**: `number`
131938
132174
 
131939
- Defined in: [lib/ws.ts:98](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L98)
132175
+ Defined in: [lib/ws.ts:101](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L101)
131940
132176
 
131941
132177
  秒数
131942
132178
 
@@ -131951,7 +132187,7 @@ lib/ws/interfaces/ISocketCloseInfo.md
131951
132187
 
131952
132188
  # Interface: ISocketCloseInfo
131953
132189
 
131954
- Defined in: [lib/ws.ts:74](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L74)
132190
+ Defined in: [lib/ws.ts:75](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L75)
131955
132191
 
131956
132192
  WebSocket 关闭信息
131957
132193
 
@@ -131961,7 +132197,7 @@ WebSocket 关闭信息
131961
132197
 
131962
132198
  > **code**: `number`
131963
132199
 
131964
- Defined in: [lib/ws.ts:75](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L75)
132200
+ Defined in: [lib/ws.ts:76](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L76)
131965
132201
 
131966
132202
  ***
131967
132203
 
@@ -131969,7 +132205,7 @@ Defined in: [lib/ws.ts:75](https://github.com/maiyunnet/kebab/blob/master/lib/ws
131969
132205
 
131970
132206
  > **reason**: `string`
131971
132207
 
131972
- Defined in: [lib/ws.ts:76](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L76)
132208
+ Defined in: [lib/ws.ts:77](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L77)
131973
132209
 
131974
132210
  lib/ws/type-aliases/TPipeCloseEvent.md
131975
132211
  ---
@@ -131984,7 +132220,7 @@ lib/ws/type-aliases/TPipeCloseEvent.md
131984
132220
 
131985
132221
  > **TPipeCloseEvent** = `"close"` \| `"end"` \| `"timeout"` \| `"error"`
131986
132222
 
131987
- Defined in: [lib/ws.ts:62](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L62)
132223
+ Defined in: [lib/ws.ts:63](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L63)
131988
132224
 
131989
132225
  WebSocket 管道结束前最后收到的底层事件
131990
132226
 
@@ -132001,7 +132237,7 @@ lib/ws/type-aliases/TPipeSide.md
132001
132237
 
132002
132238
  > **TPipeSide** = `"source"` \| `"target"`
132003
132239
 
132004
- Defined in: [lib/ws.ts:59](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L59)
132240
+ Defined in: [lib/ws.ts:60](https://github.com/maiyunnet/kebab/blob/master/lib/ws.ts#L60)
132005
132241
 
132006
132242
  WebSocket 管道首先结束的一侧
132007
132243
 
@@ -135624,11 +135860,11 @@ Defined in: [sys/mod.ts:92](https://github.com/maiyunnet/kebab/blob/master/sys/m
135624
135860
 
135625
135861
  ### \_$index
135626
135862
 
135627
- > `protected` `static` **\_$index**: `string` = `''`
135863
+ > `protected` `static` **\_$index**: `string` \| `string`[] = `''`
135628
135864
 
135629
135865
  Defined in: [sys/mod.ts:86](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L86)
135630
135866
 
135631
- 若使用 _$key 并且有多个 unique 索引,这里指定 _$key 的索引名
135867
+ 自动 key 冲突目标:MySQL 为索引名;PGSQL 为唯一字段或字段数组,PG 留空使用 _$key,不支持部分或表达式索引
135632
135868
 
135633
135869
  ***
135634
135870
 
@@ -135676,7 +135912,7 @@ Defined in: [sys/mod.ts:77](https://github.com/maiyunnet/kebab/blob/master/sys/m
135676
135912
 
135677
135913
  > `protected` **\_keyGenerator**(): `string`
135678
135914
 
135679
- Defined in: [sys/mod.ts:1987](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1987)
135915
+ Defined in: [sys/mod.ts:2048](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2048)
135680
135916
 
135681
135917
  当 _key 不为空时,则依据继承此方法的方法自动生成填充 key
135682
135918
 
@@ -135700,7 +135936,7 @@ Defined in: [sys/mod.ts:1987](https://github.com/maiyunnet/kebab/blob/master/sys
135700
135936
 
135701
135937
  > **all**(): `Promise`\<`false` \| [`Rows`](Rows.md)\<`Mod`\>\>
135702
135938
 
135703
- Defined in: [sys/mod.ts:1210](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1210)
135939
+ Defined in: [sys/mod.ts:1271](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1271)
135704
135940
 
135705
135941
  ##### Returns
135706
135942
 
@@ -135710,7 +135946,7 @@ Defined in: [sys/mod.ts:1210](https://github.com/maiyunnet/kebab/blob/master/sys
135710
135946
 
135711
135947
  > **all**(`key`): `Promise`\<`false` \| `Record`\<`string`, `Mod`\>\>
135712
135948
 
135713
- Defined in: [sys/mod.ts:1211](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1211)
135949
+ Defined in: [sys/mod.ts:1272](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1272)
135714
135950
 
135715
135951
  ##### Parameters
135716
135952
 
@@ -135738,7 +135974,7 @@ Defined in: [sys/mod.ts:1211](https://github.com/maiyunnet/kebab/blob/master/sys
135738
135974
 
135739
135975
  > **allArray**(): `Promise`\<`false` \| `Record`\<`string`, `any`\>[]\>
135740
135976
 
135741
- Defined in: [sys/mod.ts:1389](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1389)
135977
+ Defined in: [sys/mod.ts:1450](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1450)
135742
135978
 
135743
135979
  ##### Returns
135744
135980
 
@@ -135748,7 +135984,7 @@ Defined in: [sys/mod.ts:1389](https://github.com/maiyunnet/kebab/blob/master/sys
135748
135984
 
135749
135985
  > **allArray**(`key`): `Promise`\<`false` \| `Record`\<`string`, `Record`\<`string`, `any`\>\>\>
135750
135986
 
135751
- Defined in: [sys/mod.ts:1390](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1390)
135987
+ Defined in: [sys/mod.ts:1451](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1451)
135752
135988
 
135753
135989
  ##### Parameters
135754
135990
 
@@ -135766,7 +136002,7 @@ Defined in: [sys/mod.ts:1390](https://github.com/maiyunnet/kebab/blob/master/sys
135766
136002
 
135767
136003
  > **allCursor**\<`T`\>(`count`, `opt`): `Promise`\<`false` \| [`ICursorPage`](../interfaces/ICursorPage.md)\<`T`\>\>
135768
136004
 
135769
- Defined in: [sys/mod.ts:1638](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1638)
136005
+ Defined in: [sys/mod.ts:1699](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1699)
135770
136006
 
135771
136007
  读取一批游标数据,多取一条判断后续记录,不使用 OFFSET,不修改原查询
135772
136008
  排序字段必须全部非空、同向,且组合唯一;SELECT 中须包含对应字段(同名或指定 keys)
@@ -135831,7 +136067,7 @@ SELECT 结果中对应的字段名,默认去掉 by 的表别名
135831
136067
 
135832
136068
  > **append**(`sql`): `this`
135833
136069
 
135834
- Defined in: [sys/mod.ts:1896](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1896)
136070
+ Defined in: [sys/mod.ts:1957](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1957)
135835
136071
 
135836
136072
  在 sql 最后追加字符串
135837
136073
 
@@ -135851,7 +136087,7 @@ Defined in: [sys/mod.ts:1896](https://github.com/maiyunnet/kebab/blob/master/sys
135851
136087
 
135852
136088
  > **by**(`c`, `d?`): `this`
135853
136089
 
135854
- Defined in: [sys/mod.ts:1852](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1852)
136090
+ Defined in: [sys/mod.ts:1913](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1913)
135855
136091
 
135856
136092
  ORDER BY
135857
136093
 
@@ -135879,7 +136115,7 @@ ORDER BY
135879
136115
 
135880
136116
  > **contain**(`contain`): `this`
135881
136117
 
135882
- Defined in: [sys/mod.ts:1905](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1905)
136118
+ Defined in: [sys/mod.ts:1966](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1966)
135883
136119
 
135884
136120
  设置闭包含数据
135885
136121
 
@@ -135907,7 +136143,7 @@ Defined in: [sys/mod.ts:1905](https://github.com/maiyunnet/kebab/blob/master/sys
135907
136143
 
135908
136144
  > **count**(): `Promise`\<`number`\>
135909
136145
 
135910
- Defined in: [sys/mod.ts:1688](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1688)
136146
+ Defined in: [sys/mod.ts:1749](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1749)
135911
136147
 
135912
136148
  根据当前条件,筛选出当前条目该有的数据条数
135913
136149
 
@@ -135921,7 +136157,7 @@ Defined in: [sys/mod.ts:1688](https://github.com/maiyunnet/kebab/blob/master/sys
135921
136157
 
135922
136158
  > **countSql**(): `string`
135923
136159
 
135924
- Defined in: [sys/mod.ts:1709](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1709)
136160
+ Defined in: [sys/mod.ts:1770](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1770)
135925
136161
 
135926
136162
  获取当前条件下的 count 的 SQL 语句
135927
136163
 
@@ -135935,15 +136171,15 @@ Defined in: [sys/mod.ts:1709](https://github.com/maiyunnet/kebab/blob/master/sys
135935
136171
 
135936
136172
  > **create**(): `Promise`\<`boolean` \| `null`\>
135937
136173
 
135938
- Defined in: [sys/mod.ts:889](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L889)
136174
+ Defined in: [sys/mod.ts:901](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L901)
135939
136175
 
135940
- 创建数据
136176
+ 创建数据,自动 key 最多尝试 3 次;PGSQL 仅忽略指定字段的唯一冲突
135941
136177
 
135942
136178
  #### Returns
135943
136179
 
135944
136180
  `Promise`\<`boolean` \| `null`\>
135945
136181
 
135946
- true-成功,false-报错,null-唯一键非 _$key 键冲突
136182
+ true-成功,false-错误或重试耗尽,null-其他唯一冲突;PGSQL 的 SQL 错误需要回滚事务
135947
136183
 
135948
136184
  ***
135949
136185
 
@@ -135951,7 +136187,7 @@ true-成功,false-报错,null-唯一键非 _$key 键冲突
135951
136187
 
135952
136188
  > **crossJoin**(`f`, `s`, `index?`, `pre?`): `this`
135953
136189
 
135954
- Defined in: [sys/mod.ts:1784](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1784)
136190
+ Defined in: [sys/mod.ts:1845](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1845)
135955
136191
 
135956
136192
  cross join 方法
135957
136193
 
@@ -136001,7 +136237,7 @@ ON 信息
136001
136237
 
136002
136238
  > **explain**(`all?`): `Promise`\<`string` \| `false`\>
136003
136239
 
136004
- Defined in: [sys/mod.ts:1515](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1515)
136240
+ Defined in: [sys/mod.ts:1576](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1576)
136005
136241
 
136006
136242
  ##### Parameters
136007
136243
 
@@ -136017,7 +136253,7 @@ Defined in: [sys/mod.ts:1515](https://github.com/maiyunnet/kebab/blob/master/sys
136017
136253
 
136018
136254
  > **explain**(`all`): `Promise`\<`false` \| `Record`\<`string`, `any`\>\>
136019
136255
 
136020
- Defined in: [sys/mod.ts:1516](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1516)
136256
+ Defined in: [sys/mod.ts:1577](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1577)
136021
136257
 
136022
136258
  ##### Parameters
136023
136259
 
@@ -136035,7 +136271,7 @@ Defined in: [sys/mod.ts:1516](https://github.com/maiyunnet/kebab/blob/master/sys
136035
136271
 
136036
136272
  > **filter**(`s`): `this`
136037
136273
 
136038
- Defined in: [sys/mod.ts:1830](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1830)
136274
+ Defined in: [sys/mod.ts:1891](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1891)
136039
136275
 
136040
136276
  筛选器
136041
136277
 
@@ -136073,7 +136309,7 @@ Defined in: [sys/mod.ts:1830](https://github.com/maiyunnet/kebab/blob/master/sys
136073
136309
 
136074
136310
  > **first**(`lock`, `array`): `Promise`\<`false` \| `Record`\<`string`, `any`\> \| `null`\>
136075
136311
 
136076
- Defined in: [sys/mod.ts:1099](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1099)
136312
+ Defined in: [sys/mod.ts:1160](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1160)
136077
136313
 
136078
136314
  ##### Parameters
136079
136315
 
@@ -136093,7 +136329,7 @@ Defined in: [sys/mod.ts:1099](https://github.com/maiyunnet/kebab/blob/master/sys
136093
136329
 
136094
136330
  > **first**(`lock?`, `array?`): `Promise`\<`false` \| `Mod` & `Record`\<`string`, `any`\> \| `null`\>
136095
136331
 
136096
- Defined in: [sys/mod.ts:1103](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1103)
136332
+ Defined in: [sys/mod.ts:1164](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1164)
136097
136333
 
136098
136334
  ##### Parameters
136099
136335
 
@@ -136115,7 +136351,7 @@ Defined in: [sys/mod.ts:1103](https://github.com/maiyunnet/kebab/blob/master/sys
136115
136351
 
136116
136352
  > **firstArray**(`lock?`): `Promise`\<`false` \| `Record`\<`string`, `any`\> \| `null`\>
136117
136353
 
136118
- Defined in: [sys/mod.ts:1143](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1143)
136354
+ Defined in: [sys/mod.ts:1204](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1204)
136119
136355
 
136120
136356
  获取数据库第一个原生对象
136121
136357
 
@@ -136137,7 +136373,7 @@ Defined in: [sys/mod.ts:1143](https://github.com/maiyunnet/kebab/blob/master/sys
136137
136373
 
136138
136374
  > **format**(`sql?`, `data?`): `string`
136139
136375
 
136140
- Defined in: [sys/mod.ts:1932](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1932)
136376
+ Defined in: [sys/mod.ts:1993](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1993)
136141
136377
 
136142
136378
  获取带 data 的 sql 语句
136143
136379
 
@@ -136165,7 +136401,7 @@ sql 语句
136165
136401
 
136166
136402
  > **fullJoin**(`f`, `s`, `index?`, `pre?`): `this`
136167
136403
 
136168
- Defined in: [sys/mod.ts:1772](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1772)
136404
+ Defined in: [sys/mod.ts:1833](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1833)
136169
136405
 
136170
136406
  full join 方法
136171
136407
 
@@ -136227,7 +136463,7 @@ Defined in: [sys/mod.ts:881](https://github.com/maiyunnet/kebab/blob/master/sys/
136227
136463
 
136228
136464
  > **getData**(): `any`[]
136229
136465
 
136230
- Defined in: [sys/mod.ts:1923](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1923)
136466
+ Defined in: [sys/mod.ts:1984](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1984)
136231
136467
 
136232
136468
  获取全部 data
136233
136469
 
@@ -136241,7 +136477,7 @@ Defined in: [sys/mod.ts:1923](https://github.com/maiyunnet/kebab/blob/master/sys
136241
136477
 
136242
136478
  > **getSql**(): `string`
136243
136479
 
136244
- Defined in: [sys/mod.ts:1916](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1916)
136480
+ Defined in: [sys/mod.ts:1977](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1977)
136245
136481
 
136246
136482
  获取 sql 语句
136247
136483
 
@@ -136255,7 +136491,7 @@ Defined in: [sys/mod.ts:1916](https://github.com/maiyunnet/kebab/blob/master/sys
136255
136491
 
136256
136492
  > **group**(`c`): `this`
136257
136493
 
136258
- Defined in: [sys/mod.ts:1861](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1861)
136494
+ Defined in: [sys/mod.ts:1922](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1922)
136259
136495
 
136260
136496
  GROUP BY
136261
136497
 
@@ -136277,7 +136513,7 @@ GROUP BY
136277
136513
 
136278
136514
  > **having**(`s`): `this`
136279
136515
 
136280
- Defined in: [sys/mod.ts:1821](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1821)
136516
+ Defined in: [sys/mod.ts:1882](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1882)
136281
136517
 
136282
136518
  筛选器
136283
136519
 
@@ -136299,7 +136535,7 @@ Defined in: [sys/mod.ts:1821](https://github.com/maiyunnet/kebab/blob/master/sys
136299
136535
 
136300
136536
  > **hint**(`h`): `this`
136301
136537
 
136302
- Defined in: [sys/mod.ts:1812](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1812)
136538
+ Defined in: [sys/mod.ts:1873](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1873)
136303
136539
 
136304
136540
  设置 MySQL 优化器 Hint
136305
136541
  内容会以 Optimizer Hint 注释语法注入到 SELECT 关键字后
@@ -136344,7 +136580,7 @@ Hint 内容
136344
136580
 
136345
136581
  > **innerJoin**(`f`, `s`, `index?`, `pre?`): `this`
136346
136582
 
136347
- Defined in: [sys/mod.ts:1760](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1760)
136583
+ Defined in: [sys/mod.ts:1821](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1821)
136348
136584
 
136349
136585
  inner join 方法
136350
136586
 
@@ -136384,7 +136620,7 @@ ON 信息
136384
136620
 
136385
136621
  > **join**(`f`, `s?`, `type?`, `index?`, `pre?`): `this`
136386
136622
 
136387
- Defined in: [sys/mod.ts:1724](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1724)
136623
+ Defined in: [sys/mod.ts:1785](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1785)
136388
136624
 
136389
136625
  #### Parameters
136390
136626
 
@@ -136428,7 +136664,7 @@ ON 信息
136428
136664
 
136429
136665
  > **langText**(`col`, `lang`): `string`
136430
136666
 
136431
- Defined in: [sys/mod.ts:1967](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1967)
136667
+ Defined in: [sys/mod.ts:2028](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2028)
136432
136668
 
136433
136669
  获取字段的可用语种文本
136434
136670
 
@@ -136456,7 +136692,7 @@ Defined in: [sys/mod.ts:1967](https://github.com/maiyunnet/kebab/blob/master/sys
136456
136692
 
136457
136693
  > **leftJoin**(`f`, `s`, `index?`, `pre?`): `this`
136458
136694
 
136459
- Defined in: [sys/mod.ts:1736](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1736)
136695
+ Defined in: [sys/mod.ts:1797](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1797)
136460
136696
 
136461
136697
  left join 方法
136462
136698
 
@@ -136496,7 +136732,7 @@ ON 信息
136496
136732
 
136497
136733
  > **limit**(`a`, `b?`): `this`
136498
136734
 
136499
- Defined in: [sys/mod.ts:1874](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1874)
136735
+ Defined in: [sys/mod.ts:1935](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1935)
136500
136736
 
136501
136737
  LIMIT
136502
136738
 
@@ -136524,7 +136760,7 @@ LIMIT
136524
136760
 
136525
136761
  > **page**(`count`, `page?`): `this`
136526
136762
 
136527
- Defined in: [sys/mod.ts:1885](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1885)
136763
+ Defined in: [sys/mod.ts:1946](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1946)
136528
136764
 
136529
136765
  分页
136530
136766
 
@@ -136552,7 +136788,7 @@ Defined in: [sys/mod.ts:1885](https://github.com/maiyunnet/kebab/blob/master/sys
136552
136788
 
136553
136789
  > **refresh**(`lock?`): `Promise`\<`boolean` \| `null`\>
136554
136790
 
136555
- Defined in: [sys/mod.ts:1011](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1011)
136791
+ Defined in: [sys/mod.ts:1069](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1069)
136556
136792
 
136557
136793
  刷新当前模型获取最新数据
136558
136794
 
@@ -136574,7 +136810,7 @@ Defined in: [sys/mod.ts:1011](https://github.com/maiyunnet/kebab/blob/master/sys
136574
136810
 
136575
136811
  > **remove**(): `Promise`\<`boolean`\>
136576
136812
 
136577
- Defined in: [sys/mod.ts:1077](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1077)
136813
+ Defined in: [sys/mod.ts:1138](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1138)
136578
136814
 
136579
136815
  移除本条目
136580
136816
 
@@ -136588,7 +136824,7 @@ Defined in: [sys/mod.ts:1077](https://github.com/maiyunnet/kebab/blob/master/sys
136588
136824
 
136589
136825
  > **rightJoin**(`f`, `s`, `index?`, `pre?`): `this`
136590
136826
 
136591
- Defined in: [sys/mod.ts:1748](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1748)
136827
+ Defined in: [sys/mod.ts:1809](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1809)
136592
136828
 
136593
136829
  right join 方法
136594
136830
 
@@ -136628,7 +136864,7 @@ ON 信息
136628
136864
 
136629
136865
  > **save**(`where?`): `Promise`\<`boolean`\>
136630
136866
 
136631
- Defined in: [sys/mod.ts:1043](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1043)
136867
+ Defined in: [sys/mod.ts:1102](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1102)
136632
136868
 
136633
136869
  更新 set 的数据到数据库,有未保存数据时才保存
136634
136870
 
@@ -136638,12 +136874,14 @@ Defined in: [sys/mod.ts:1043](https://github.com/maiyunnet/kebab/blob/master/sys
136638
136874
 
136639
136875
  `any`
136640
136876
 
136641
- 自定义筛选条件,默认根据主键筛选
136877
+ 非空筛选条件,省略时必须有主键
136642
136878
 
136643
136879
  #### Returns
136644
136880
 
136645
136881
  `Promise`\<`boolean`\>
136646
136882
 
136883
+ 是否成功,失败保留待写数据
136884
+
136647
136885
  ***
136648
136886
 
136649
136887
  ### set()
@@ -136724,7 +136962,7 @@ Defined in: [sys/mod.ts:847](https://github.com/maiyunnet/kebab/blob/master/sys/
136724
136962
 
136725
136963
  > **toArray**\<`TC`\>(): [`TOnlyProperties`](../type-aliases/TOnlyProperties.md)\<`InstanceType`\<`TC`\>\> & `Record`\<`string`, `any`\>
136726
136964
 
136727
- Defined in: [sys/mod.ts:1939](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1939)
136965
+ Defined in: [sys/mod.ts:2000](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2000)
136728
136966
 
136729
136967
  获取值对象,获取的是新创建的数组
136730
136968
 
@@ -136744,7 +136982,7 @@ Defined in: [sys/mod.ts:1939](https://github.com/maiyunnet/kebab/blob/master/sys
136744
136982
 
136745
136983
  > **total**(`f?`): `Promise`\<`number`\>
136746
136984
 
136747
- Defined in: [sys/mod.ts:1573](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1573)
136985
+ Defined in: [sys/mod.ts:1634](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1634)
136748
136986
 
136749
136987
  获取总条数,自动抛弃 LIMIT,仅用于获取数据的情况(select)
136750
136988
 
@@ -136764,7 +137002,7 @@ Defined in: [sys/mod.ts:1573](https://github.com/maiyunnet/kebab/blob/master/sys
136764
137002
 
136765
137003
  > **totalEstimate**(): `Promise`\<`number` \| `false`\>
136766
137004
 
136767
- Defined in: [sys/mod.ts:1599](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1599)
137005
+ Defined in: [sys/mod.ts:1660](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1660)
136768
137006
 
136769
137007
  从 PostgreSQL 执行计划估算查询总行数,移除外层排序和分页,不执行数据扫描
136770
137008
  请在应用游标条件前调用;非 PostgreSQL、框架分表联查或查询失败返回 false,绝不回退到 COUNT
@@ -136781,7 +137019,7 @@ Defined in: [sys/mod.ts:1599](https://github.com/maiyunnet/kebab/blob/master/sys
136781
137019
 
136782
137020
  > **union**(`f`, `type?`): `this`
136783
137021
 
136784
- Defined in: [sys/mod.ts:1154](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1154)
137022
+ Defined in: [sys/mod.ts:1215](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1215)
136785
137023
 
136786
137024
  联合查询表数据
136787
137025
 
@@ -136809,7 +137047,7 @@ Defined in: [sys/mod.ts:1154](https://github.com/maiyunnet/kebab/blob/master/sys
136809
137047
 
136810
137048
  > **unionAll**(`f`): `this`
136811
137049
 
136812
- Defined in: [sys/mod.ts:1184](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1184)
137050
+ Defined in: [sys/mod.ts:1245](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1245)
136813
137051
 
136814
137052
  所有联合查询表数据
136815
137053
 
@@ -136831,7 +137069,7 @@ Defined in: [sys/mod.ts:1184](https://github.com/maiyunnet/kebab/blob/master/sys
136831
137069
 
136832
137070
  > **unsaved**(): `boolean`
136833
137071
 
136834
- Defined in: [sys/mod.ts:1958](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1958)
137072
+ Defined in: [sys/mod.ts:2019](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2019)
136835
137073
 
136836
137074
  当前是否设置了未保存 --=
136837
137075
 
@@ -136845,7 +137083,7 @@ Defined in: [sys/mod.ts:1958](https://github.com/maiyunnet/kebab/blob/master/sys
136845
137083
 
136846
137084
  > **updates**(): `Record`\<`string`, `any`\>
136847
137085
 
136848
- Defined in: [sys/mod.ts:1947](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1947)
137086
+ Defined in: [sys/mod.ts:2008](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2008)
136849
137087
 
136850
137088
  获取当前设置要提交的数据
136851
137089
 
@@ -136859,9 +137097,11 @@ Defined in: [sys/mod.ts:1947](https://github.com/maiyunnet/kebab/blob/master/sys
136859
137097
 
136860
137098
  > **upsert**(`conflict`): `Promise`\<`boolean`\>
136861
137099
 
136862
- Defined in: [sys/mod.ts:980](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L980)
137100
+ Defined in: [sys/mod.ts:995](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L995)
136863
137101
 
136864
- 插入数据,如果存在则更新(UPSERT)
137102
+ 插入数据,如果业务唯一键已存在则更新,保留已有主键和自动 key
137103
+ PGSQL 为原子 UPSERT,自动 key 只生成一次,SQL 错误需回滚事务
137104
+ MySQL 分步执行;自动 key 有多个唯一索引时须配置 _$index,整笔原子性由调用方事务保证
136865
137105
 
136866
137106
  #### Parameters
136867
137107
 
@@ -136869,19 +137109,21 @@ Defined in: [sys/mod.ts:980](https://github.com/maiyunnet/kebab/blob/master/sys/
136869
137109
 
136870
137110
  `string` \| `string`[]
136871
137111
 
136872
- 冲突字段,不能为 _$key 或 _$primary,应该是你要判断的唯一索引字段
137112
+ 已通过 set 赋非 NULL 值的业务唯一字段,不得包含 _$key 或 _$primary;PGSQL 不支持部分或表达式索引
136873
137113
 
136874
137114
  #### Returns
136875
137115
 
136876
137116
  `Promise`\<`boolean`\>
136877
137117
 
137118
+ 是否成功;至少需要一个可更新字段,失败保留待写数据
137119
+
136878
137120
  ***
136879
137121
 
136880
137122
  ### where()
136881
137123
 
136882
137124
  > **where**(`s`): `this`
136883
137125
 
136884
- Defined in: [sys/mod.ts:1841](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1841)
137126
+ Defined in: [sys/mod.ts:1902](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1902)
136885
137127
 
136886
137128
  是 filter 的别名
136887
137129
 
@@ -138146,7 +138388,7 @@ sys/mod/interfaces/IModUnionItem.md
138146
138388
 
138147
138389
  # Interface: IModUnionItem
138148
138390
 
138149
- Defined in: [sys/mod.ts:2001](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2001)
138391
+ Defined in: [sys/mod.ts:2062](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2062)
138150
138392
 
138151
138393
  ## Properties
138152
138394
 
@@ -138154,7 +138396,7 @@ Defined in: [sys/mod.ts:2001](https://github.com/maiyunnet/kebab/blob/master/sys
138154
138396
 
138155
138397
  > **field**: `string`
138156
138398
 
138157
- Defined in: [sys/mod.ts:2002](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2002)
138399
+ Defined in: [sys/mod.ts:2063](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2063)
138158
138400
 
138159
138401
  ***
138160
138402
 
@@ -138162,7 +138404,7 @@ Defined in: [sys/mod.ts:2002](https://github.com/maiyunnet/kebab/blob/master/sys
138162
138404
 
138163
138405
  > `optional` **where?**: `any`
138164
138406
 
138165
- Defined in: [sys/mod.ts:2003](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2003)
138407
+ Defined in: [sys/mod.ts:2064](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2064)
138166
138408
 
138167
138409
  sys/mod/interfaces/IRows.md
138168
138410
  ---
@@ -138175,7 +138417,7 @@ sys/mod/interfaces/IRows.md
138175
138417
 
138176
138418
  # Interface: IRows\<T\>
138177
138419
 
138178
- Defined in: [sys/mod.ts:1995](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1995)
138420
+ Defined in: [sys/mod.ts:2056](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2056)
138179
138421
 
138180
138422
  ## Extends
138181
138423
 
@@ -138193,7 +138435,7 @@ Defined in: [sys/mod.ts:1995](https://github.com/maiyunnet/kebab/blob/master/sys
138193
138435
 
138194
138436
  > `readonly` **length**: `number`
138195
138437
 
138196
- Defined in: [sys/mod.ts:1996](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1996)
138438
+ Defined in: [sys/mod.ts:2057](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2057)
138197
138439
 
138198
138440
  ## Methods
138199
138441
 
@@ -138201,7 +138443,7 @@ Defined in: [sys/mod.ts:1996](https://github.com/maiyunnet/kebab/blob/master/sys
138201
138443
 
138202
138444
  > **item**(`index`): `T`
138203
138445
 
138204
- Defined in: [sys/mod.ts:1997](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1997)
138446
+ Defined in: [sys/mod.ts:2058](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2058)
138205
138447
 
138206
138448
  #### Parameters
138207
138449
 
@@ -138219,7 +138461,7 @@ Defined in: [sys/mod.ts:1997](https://github.com/maiyunnet/kebab/blob/master/sys
138219
138461
 
138220
138462
  > **toArray**(): `Record`\<`string`, `any`\>[]
138221
138463
 
138222
- Defined in: [sys/mod.ts:1998](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L1998)
138464
+ Defined in: [sys/mod.ts:2059](https://github.com/maiyunnet/kebab/blob/master/sys/mod.ts#L2059)
138223
138465
 
138224
138466
  #### Returns
138225
138467