From 179851ff36e74318af9ffc0bf33cb24ff1a25322 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A3=8E=E6=89=87=E6=BB=91=E7=BF=94=E7=BF=BC?= Date: Sun, 3 Aug 2025 12:19:16 +0000 Subject: [PATCH] Tunnel: Add portMap --- docs/.vuepress/config/sidebar/zh.ts | 2 +- docs/config/inbounds/index.md | 2 +- .../inbounds/{tunnel(dokodemo).md => tunnel.md} | 13 +++++++++---- docs/config/transport.md | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) rename docs/config/inbounds/{tunnel(dokodemo).md => tunnel.md} (79%) diff --git a/docs/.vuepress/config/sidebar/zh.ts b/docs/.vuepress/config/sidebar/zh.ts index 302d846..014463c 100755 --- a/docs/.vuepress/config/sidebar/zh.ts +++ b/docs/.vuepress/config/sidebar/zh.ts @@ -34,7 +34,7 @@ export const sidebarZh: SidebarConfig = { { text: "入站协议", children: [ - "/config/inbounds/tunnel(dokodemo).md", + "/config/inbounds/tunnel.md", "/config/inbounds/http.md", "/config/inbounds/shadowsocks.md", "/config/inbounds/socks.md", diff --git a/docs/config/inbounds/index.md b/docs/config/inbounds/index.md index dd75e16..3d0187c 100644 --- a/docs/config/inbounds/index.md +++ b/docs/config/inbounds/index.md @@ -2,7 +2,7 @@ Xray 支持以下入站协议: -- [Dokodemo-Door](../inbounds/tunnel(dokodemo).md) +- [Dokodemo-Door](../inbounds/tunnel.md) - [HTTP](../inbounds/http.md) - [Shadowsocks](../inbounds/shadowsocks.md) - [Socks](../inbounds/socks.md) diff --git a/docs/config/inbounds/tunnel(dokodemo).md b/docs/config/inbounds/tunnel.md similarity index 79% rename from docs/config/inbounds/tunnel(dokodemo).md rename to docs/config/inbounds/tunnel.md index 09cccda..b528915 100644 --- a/docs/config/inbounds/tunnel(dokodemo).md +++ b/docs/config/inbounds/tunnel.md @@ -1,6 +1,6 @@ -# Tunnel +# Tunnel(dokodemo) -Tunnel, 或称 Dokodemo door(任意门)可以监听一个本地端口,并把所有进入此端口的数据通过 outbound 发送至指定服务器的一个端口,从而达到端口映射的效果。 +Tunnel(隧道),旧称 dokodemo-door(任意门)可以监听一个本地端口,并把所有进入此端口的数据通过 outbound 发送至指定服务器的一个端口,从而达到端口映射的效果。 ## InboundConfigurationObject @@ -8,6 +8,7 @@ Tunnel, 或称 Dokodemo door(任意门)可以监听一个本地端口,并 { "address": "8.8.8.8", "port": 53, + "portMap": [], "network": "tcp", "followRedirect": false, "userLevel": 0 @@ -22,7 +23,11 @@ Tunnel, 或称 Dokodemo door(任意门)可以监听一个本地端口,并 > `port`: number -将流量转发到目标地址的指定端口,范围 \[0, 65535\],数值类型。不填或者为 0 时默认为监听地址。 +将流量转发到目标地址的指定端口,范围 \[0, 65535\],数值类型。不填或者为 0 时默认为监听端口。 + +> `portMap`: map[string]string + +一个map, 映射本地端口和需要的远程端口(如果 inbound 监听了数个端口), 如果本地端口未包含在其中则按 `port` 设置处理。 > `network`: "tcp" | "udp" | "tcp,udp" @@ -52,7 +57,7 @@ userLevel 的值, 对应 [policy](../policy.md#policyobject) 中 `level` 的值. { "listen": "127.0.0.1", "port": 25565, - "protocol": "dokodemo-door", + "protocol": "tunnel", "settings": { "address": "mc.hypixel.net", "port": 25565, diff --git a/docs/config/transport.md b/docs/config/transport.md index f4c3233..3931b7a 100644 --- a/docs/config/transport.md +++ b/docs/config/transport.md @@ -683,7 +683,7 @@ OCSP 装订更新间隔,单位为秒,默认值为 0. 任意非 0 值将启 透明代理需要 Root 或 `CAP_NET_ADMIN` 权限。 ::: danger -当 [Dokodemo-door](./inbounds/tunnel(dokodemo).md) 中指定了 `followRedirect`为`true`,且 Sockopt 设置中的`tproxy` 为空时,Sockopt +当 [Dokodemo-door](./inbounds/tunnel.md) 中指定了 `followRedirect`为`true`,且 Sockopt 设置中的`tproxy` 为空时,Sockopt 设置中的`tproxy` 的值会被设为 `"redirect"`。 :::