@maiyunnet/kebab 9.26.2 → 9.26.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/abox/proxy.d.ts +9 -0
- package/abox/proxy.js +62 -0
- package/doc/kebab-rag.md +436 -200
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/lib/fs.js +1 -1
- package/lib/undici/proxy.d.ts +36 -0
- package/lib/undici/proxy.js +21 -0
- package/lib/undici.d.ts +10 -6
- package/lib/undici.js +11 -41
- package/lib/ws.d.ts +4 -1
- package/lib/ws.js +3 -3
- package/package.json +1 -1
- package/sys/child.js +6 -14
- package/sys/ctr.js +1 -1
- package/sys/route.js +10 -11
- package/www/example/ctr/test.js +2 -2
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.
|
|
1797
|
+
> `const` **VER**: `"9.26.4"` = `'9.26.4'`
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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
|
|
|
@@ -138282,7 +138518,7 @@ sys/route/functions/getFormData.md
|
|
|
138282
138518
|
|
|
138283
138519
|
> **getFormData**(`req`, `events?`, `limits?`): `Promise`\<`false` \| \{ `files`: `Record`\<`string`, [`IPostFile`](../../../index/interfaces/IPostFile.md) \| [`IPostFile`](../../../index/interfaces/IPostFile.md)[]\>; `post`: `Record`\<`string`, [`Json`](../../../index/type-aliases/Json.md)\>; \}\>
|
|
138284
138520
|
|
|
138285
|
-
Defined in: [sys/route.ts:
|
|
138521
|
+
Defined in: [sys/route.ts:1101](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1101)
|
|
138286
138522
|
|
|
138287
138523
|
获取 formdata 的 post
|
|
138288
138524
|
|
|
@@ -138325,7 +138561,7 @@ sys/route/functions/getPost.md
|
|
|
138325
138561
|
|
|
138326
138562
|
> **getPost**(`req`): `Promise`\<`false` \| \{ `input`: `string`; `post`: `Record`\<`string`, `any`\>; `raw`: `Record`\<`string`, `any`\>; \}\>
|
|
138327
138563
|
|
|
138328
|
-
Defined in: [sys/route.ts:
|
|
138564
|
+
Defined in: [sys/route.ts:936](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L936)
|
|
138329
138565
|
|
|
138330
138566
|
获取 post 对象(通常已自动获取),如果是文件上传(formdata)的情况则不获取
|
|
138331
138567
|
|
|
@@ -138356,7 +138592,7 @@ sys/route/functions/run.md
|
|
|
138356
138592
|
|
|
138357
138593
|
> **run**(`data`): `Promise`\<`boolean`\>
|
|
138358
138594
|
|
|
138359
|
-
Defined in: [sys/route.ts:
|
|
138595
|
+
Defined in: [sys/route.ts:109](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L109)
|
|
138360
138596
|
|
|
138361
138597
|
若为动态路径则执行此函数,此函数不进行判断 kebab.json 是否存在
|
|
138362
138598
|
|
|
@@ -138443,7 +138679,7 @@ sys/route/functions/unlinkUploadFiles.md
|
|
|
138443
138679
|
|
|
138444
138680
|
> **unlinkUploadFiles**(`cctr`): `Promise`\<`void`\>
|
|
138445
138681
|
|
|
138446
|
-
Defined in: [sys/route.ts:
|
|
138682
|
+
Defined in: [sys/route.ts:894](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L894)
|
|
138447
138683
|
|
|
138448
138684
|
删除本次请求所有已上传的临时文件
|
|
138449
138685
|
|
|
@@ -138472,7 +138708,7 @@ sys/route/functions/waitCtr.md
|
|
|
138472
138708
|
|
|
138473
138709
|
> **waitCtr**(`cctr`): `Promise`\<`void`\>
|
|
138474
138710
|
|
|
138475
|
-
Defined in: [sys/route.ts:
|
|
138711
|
+
Defined in: [sys/route.ts:914](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L914)
|
|
138476
138712
|
|
|
138477
138713
|
等待异步任务结束,并删除临时文件,如果结束后还有事务没关闭,则会在本函数中打印控制台并且写入 log 文件
|
|
138478
138714
|
此时其实已经给客户端返回了,此处等待不消耗客户端的等待时间
|
|
@@ -138526,7 +138762,7 @@ sys/route/interfaces/IFormDataError.md
|
|
|
138526
138762
|
|
|
138527
138763
|
# Interface: IFormDataError
|
|
138528
138764
|
|
|
138529
|
-
Defined in: [sys/route.ts:
|
|
138765
|
+
Defined in: [sys/route.ts:1056](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1056)
|
|
138530
138766
|
|
|
138531
138767
|
解析上传数据时的失败原因,只提供错误码和限制值,不带临时路径或异常对象
|
|
138532
138768
|
|
|
@@ -138536,7 +138772,7 @@ Defined in: [sys/route.ts:1058](https://github.com/maiyunnet/kebab/blob/master/s
|
|
|
138536
138772
|
|
|
138537
138773
|
> **code**: `"INVALID_BOUNDARY"` \| `"FILE_TOO_LARGE"` \| `"TOTAL_TOO_LARGE"` \| `"FIELD_TOO_LARGE"` \| `"HEADER_TOO_LARGE"` \| `"TOO_MANY_PARTS"` \| `"FILE_TYPE"` \| `"TIMEOUT"` \| `"TEMP_FILE_ERROR"` \| `"REQUEST_ERROR"` \| `"REQUEST_ABORTED"`
|
|
138538
138774
|
|
|
138539
|
-
Defined in: [sys/route.ts:
|
|
138775
|
+
Defined in: [sys/route.ts:1057](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1057)
|
|
138540
138776
|
|
|
138541
138777
|
***
|
|
138542
138778
|
|
|
@@ -138544,7 +138780,7 @@ Defined in: [sys/route.ts:1059](https://github.com/maiyunnet/kebab/blob/master/s
|
|
|
138544
138780
|
|
|
138545
138781
|
> `optional` **limit?**: `number`
|
|
138546
138782
|
|
|
138547
|
-
Defined in: [sys/route.ts:
|
|
138783
|
+
Defined in: [sys/route.ts:1061](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1061)
|
|
138548
138784
|
|
|
138549
138785
|
超出的限制值:大小用字节,超时用毫秒,字段和文件数量用个
|
|
138550
138786
|
|
|
@@ -138559,7 +138795,7 @@ sys/route/interfaces/IFormDataEvents.md
|
|
|
138559
138795
|
|
|
138560
138796
|
# Interface: IFormDataEvents
|
|
138561
138797
|
|
|
138562
|
-
Defined in: [sys/route.ts:
|
|
138798
|
+
Defined in: [sys/route.ts:1065](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1065)
|
|
138563
138799
|
|
|
138564
138800
|
multipart 文件处理及失败通知
|
|
138565
138801
|
|
|
@@ -138569,7 +138805,7 @@ multipart 文件处理及失败通知
|
|
|
138569
138805
|
|
|
138570
138806
|
> `optional` **onerror?**: (`error`) => `void`
|
|
138571
138807
|
|
|
138572
|
-
Defined in: [sys/route.ts:
|
|
138808
|
+
Defined in: [sys/route.ts:1073](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1073)
|
|
138573
138809
|
|
|
138574
138810
|
首次失败时调用一次,getFormData 返回 false;若连接已断开,可能无法回复客户端
|
|
138575
138811
|
|
|
@@ -138589,7 +138825,7 @@ Defined in: [sys/route.ts:1075](https://github.com/maiyunnet/kebab/blob/master/s
|
|
|
138589
138825
|
|
|
138590
138826
|
> `optional` **onfiledata?**: (`chunk`) => `void`
|
|
138591
138827
|
|
|
138592
|
-
Defined in: [sys/route.ts:
|
|
138828
|
+
Defined in: [sys/route.ts:1069](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1069)
|
|
138593
138829
|
|
|
138594
138830
|
文件上传时触发,仅 start 返回 true 时触发
|
|
138595
138831
|
|
|
@@ -138609,7 +138845,7 @@ Defined in: [sys/route.ts:1071](https://github.com/maiyunnet/kebab/blob/master/s
|
|
|
138609
138845
|
|
|
138610
138846
|
> `optional` **onfileend?**: () => `void`
|
|
138611
138847
|
|
|
138612
|
-
Defined in: [sys/route.ts:
|
|
138848
|
+
Defined in: [sys/route.ts:1071](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1071)
|
|
138613
138849
|
|
|
138614
138850
|
文件上传结束时触发,仅 start 返回 true 时触发
|
|
138615
138851
|
|
|
@@ -138623,7 +138859,7 @@ Defined in: [sys/route.ts:1073](https://github.com/maiyunnet/kebab/blob/master/s
|
|
|
138623
138859
|
|
|
138624
138860
|
> `optional` **onfilestart?**: (`name`) => `boolean` \| `undefined`
|
|
138625
138861
|
|
|
138626
|
-
Defined in: [sys/route.ts:
|
|
138862
|
+
Defined in: [sys/route.ts:1067](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1067)
|
|
138627
138863
|
|
|
138628
138864
|
文件开始上传时触发,返回 true 则跳过该文件的保存
|
|
138629
138865
|
|
|
@@ -138648,7 +138884,7 @@ sys/route/interfaces/IFormDataLimits.md
|
|
|
138648
138884
|
|
|
138649
138885
|
# Interface: IFormDataLimits
|
|
138650
138886
|
|
|
138651
|
-
Defined in: [sys/route.ts:
|
|
138887
|
+
Defined in: [sys/route.ts:1077](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1077)
|
|
138652
138888
|
|
|
138653
138889
|
multipart 上传限制
|
|
138654
138890
|
|
|
@@ -138658,7 +138894,7 @@ multipart 上传限制
|
|
|
138658
138894
|
|
|
138659
138895
|
> `optional` **allowedExts?**: `string`[]
|
|
138660
138896
|
|
|
138661
|
-
Defined in: [sys/route.ts:
|
|
138897
|
+
Defined in: [sys/route.ts:1081](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1081)
|
|
138662
138898
|
|
|
138663
138899
|
允许的文件扩展名(含点号),如 ['.jpg', '.png', '.pdf']
|
|
138664
138900
|
|
|
@@ -138668,7 +138904,7 @@ Defined in: [sys/route.ts:1083](https://github.com/maiyunnet/kebab/blob/master/s
|
|
|
138668
138904
|
|
|
138669
138905
|
> `optional` **maxFieldSize?**: `number`
|
|
138670
138906
|
|
|
138671
|
-
Defined in: [sys/route.ts:
|
|
138907
|
+
Defined in: [sys/route.ts:1083](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1083)
|
|
138672
138908
|
|
|
138673
138909
|
单个字段(非文件)最大字节数,默认 1 MB
|
|
138674
138910
|
|
|
@@ -138678,7 +138914,7 @@ Defined in: [sys/route.ts:1085](https://github.com/maiyunnet/kebab/blob/master/s
|
|
|
138678
138914
|
|
|
138679
138915
|
> `optional` **maxFileSize?**: `number`
|
|
138680
138916
|
|
|
138681
|
-
Defined in: [sys/route.ts:
|
|
138917
|
+
Defined in: [sys/route.ts:1079](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1079)
|
|
138682
138918
|
|
|
138683
138919
|
单个文件最大字节数
|
|
138684
138920
|
|
|
@@ -138688,7 +138924,7 @@ Defined in: [sys/route.ts:1081](https://github.com/maiyunnet/kebab/blob/master/s
|
|
|
138688
138924
|
|
|
138689
138925
|
> `optional` **maxHeaderSize?**: `number`
|
|
138690
138926
|
|
|
138691
|
-
Defined in: [sys/route.ts:
|
|
138927
|
+
Defined in: [sys/route.ts:1087](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1087)
|
|
138692
138928
|
|
|
138693
138929
|
每个字段或文件的 multipart 头部最多多少字节,默认 16 KB
|
|
138694
138930
|
|
|
@@ -138698,7 +138934,7 @@ Defined in: [sys/route.ts:1089](https://github.com/maiyunnet/kebab/blob/master/s
|
|
|
138698
138934
|
|
|
138699
138935
|
> `optional` **maxParts?**: `number`
|
|
138700
138936
|
|
|
138701
|
-
Defined in: [sys/route.ts:
|
|
138937
|
+
Defined in: [sys/route.ts:1089](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1089)
|
|
138702
138938
|
|
|
138703
138939
|
multipart 字段与文件总数量,默认 1000
|
|
138704
138940
|
|
|
@@ -138708,7 +138944,7 @@ multipart 字段与文件总数量,默认 1000
|
|
|
138708
138944
|
|
|
138709
138945
|
> `optional` **maxTotalSize?**: `number`
|
|
138710
138946
|
|
|
138711
|
-
Defined in: [sys/route.ts:
|
|
138947
|
+
Defined in: [sys/route.ts:1085](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1085)
|
|
138712
138948
|
|
|
138713
138949
|
整体请求最大字节数,不设置或设为 0 则不限制
|
|
138714
138950
|
|
|
@@ -138718,6 +138954,6 @@ Defined in: [sys/route.ts:1087](https://github.com/maiyunnet/kebab/blob/master/s
|
|
|
138718
138954
|
|
|
138719
138955
|
> `optional` **timeout?**: `number`
|
|
138720
138956
|
|
|
138721
|
-
Defined in: [sys/route.ts:
|
|
138957
|
+
Defined in: [sys/route.ts:1091](https://github.com/maiyunnet/kebab/blob/master/sys/route.ts#L1091)
|
|
138722
138958
|
|
|
138723
138959
|
整体请求超时时间(毫秒),默认 5 分钟,设为 0 禁用超时
|