Tunnel: Add portMap

pull/732/head
风扇滑翔翼 2025-08-03 12:19:16 +00:00 committed by GitHub
parent c814f567f4
commit 179851ff36
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 12 additions and 7 deletions

View File

@ -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",

View File

@ -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)

View File

@ -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,

View File

@ -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"`
:::