From 41e2bea41667bd6c2786c444ee718d9d8bccaf63 Mon Sep 17 00:00:00 2001 From: fatedier Date: Tue, 9 Apr 2024 14:56:22 +0800 Subject: [PATCH] add doc for v0.56.0 (#76) --- content/zh-cn/docs/Features/common/range.md | 20 ++++++++++++++++++++ content/zh-cn/docs/Features/common/ssh.md | 2 -- content/zh-cn/docs/Reference/common.md | 7 +++++++ content/zh-cn/docs/Reference/proxy.md | 1 + 4 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 content/zh-cn/docs/Features/common/range.md diff --git a/content/zh-cn/docs/Features/common/range.md b/content/zh-cn/docs/Features/common/range.md new file mode 100644 index 0000000..bb746d7 --- /dev/null +++ b/content/zh-cn/docs/Features/common/range.md @@ -0,0 +1,20 @@ +--- +title: "端口范围映射" +weight: 80 +--- + +*Added in v0.56.0* + +我们可以利用 Go template 的 range 语法结合内置的 `parseNumberRangePair` 函数来实现端口范围映射。 + +下面的示例,应用运行后会创建 8 个代理,名称为 `test-6000, test-6001 ... test-6007`,分别将远端的端口映射到本地。 + +``` +{{- range $_, $v := parseNumberRangePair "6000-6006,6007" "6000-6006,6007" }} +[[proxies]] +name = "tcp-{{ $v.First }}" +type = "tcp" +localPort = {{ $v.First }} +remotePort = {{ $v.Second }} +{{- end }} +``` diff --git a/content/zh-cn/docs/Features/common/ssh.md b/content/zh-cn/docs/Features/common/ssh.md index 61f6b24..290c3a2 100644 --- a/content/zh-cn/docs/Features/common/ssh.md +++ b/content/zh-cn/docs/Features/common/ssh.md @@ -13,8 +13,6 @@ frp 支持在 frps 端监听一个 ssh 端口,通过走 ssh -R 协议来完成 SSH 反向隧道代理和通过 frp 代理 SSH 端口是不同的 2 个概念。SSH 反向隧道代理本质上是在你不想使用 frpc 的时候,通过 ssh client 连接 frps 来完成基本的反向代理。 - - ## 参数 ```toml diff --git a/content/zh-cn/docs/Reference/common.md b/content/zh-cn/docs/Reference/common.md index cbc54f6..f2a83b5 100644 --- a/content/zh-cn/docs/Reference/common.md +++ b/content/zh-cn/docs/Reference/common.md @@ -56,3 +56,10 @@ description: > | Field | Type | Description | Required | | :--- | :--- | :--- | :--- | | set | map[string]string | 在 Header 中设置指定的 KV 值。 | No | + +### HTTPHeader + +| Field | Type | Description | Required | +| :--- | :--- | :--- | :--- | +| name | string | Header 名称。 | Yes | +| value | string | Header 值。 | Yes | diff --git a/content/zh-cn/docs/Reference/proxy.md b/content/zh-cn/docs/Reference/proxy.md index 7e0635d..5b6825b 100644 --- a/content/zh-cn/docs/Reference/proxy.md +++ b/content/zh-cn/docs/Reference/proxy.md @@ -52,6 +52,7 @@ description: > | maxFailed | int | 健康检查连续错误次数,连续检查错误多少次认为服务不健康,默认为 1。 | No | | intervalSeconds | int | 健康检查周期(秒),每隔多长时间进行一次健康检查,默认为 10s。 | No | | path | string | 健康检查的 HTTP 接口,如果健康检查类型是 http,则需要配置此参数,指定发送 http 请求的 path,例如 `/health`。 | No | +| httpHeaders | [[]HTTPHeader](../common#httpheader) | 健康检查的 HTTP 请求头,仅在健康检查类型是 http 时生效。 | No | ### DomainConfig