From dface33524917104388f813868fcc88b97e1081f Mon Sep 17 00:00:00 2001 From: e1732a364fed <75717694+e1732a364fed@users.noreply.github.com> Date: Fri, 6 May 2022 22:58:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E5=88=86=E6=B5=81=E7=9A=84inTag?= =?UTF-8?q?=E6=94=B9=E5=90=8D=E4=B8=BAfromTag,=20dialTag=E6=94=B9=E5=90=8D?= =?UTF-8?q?=E4=B8=BA=20toTag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- conf_test.go | 4 ++-- examples/multi.client.toml | 18 +++++++++--------- examples/socks5.toml | 8 ++++---- examples/vless_v1.server.toml | 4 ++-- examples/vlesss.client.toml | 2 +- netLayer/route_conf.go | 4 ++-- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 829d1ba..3da05b4 100644 --- a/README.md +++ b/README.md @@ -281,7 +281,7 @@ v0协议是直接兼容现有v2ray/xray的,比如可以客户端用任何现 默认回落,以及按 path/sni/alpn 回落 -按 geoip,geosite,ip,cidr,domain,inTag,network 分流,以及 按国别 顶级域名分流,用到了 mmdb和 v2fly的社区维护版域名列表 +按 geoip,geosite,ip,cidr,domain,tag,network 分流,以及 按国别 顶级域名分流,用到了 mmdb和 v2fly的社区维护版域名列表 支持utls伪装tls指纹,本作的 utls 还可以在 用 websocket和grpc 时使用 diff --git a/conf_test.go b/conf_test.go index cc85134..dcac9dd 100644 --- a/conf_test.go +++ b/conf_test.go @@ -50,14 +50,14 @@ extra = { ws_earlydata = 4096 } [[route]] -dialTag = "my_ws1" +toTag = "my_ws1" country = ["CN"] ip = ["0.0.0.0/8","10.0.0.0/8","fe80::/10","10.0.0.1"] domain = ["www.google.com","www.twitter.com"] network = ["tcp","udp"] [[route]] -dialTag = "my_vless1" +toTag = "my_vless1" [[fallback]] diff --git a/examples/multi.client.toml b/examples/multi.client.toml index 676b051..ea10efb 100644 --- a/examples/multi.client.toml +++ b/examples/multi.client.toml @@ -100,17 +100,17 @@ protocol = "reject" # 和 v2ray的 blackhole 等价. # 下面这个route中,我们只给了tag, 没给其它限定条件,这个是无效的,永远匹配不到。 #[[route]] -#dialTag = "my_vless1" +#toTag = "my_vless1" -# 关于 [[route]] 的 dialTag: +# 关于 [[route]] 的 toTag: # direct并不需要 在dial中实际给出。 "proxy" 代表首个dial, 也不需要实际赋值该tag [[route]] -dialTag = "my_ws1" +toTag = "my_ws1" country = ["US"] # 上面这个规则的 意思就是所有向US国家的ip请求的数据 全都 通过 my_ws1 这个dial 拨号, 如果你写direct自然就直接直连 @@ -118,22 +118,22 @@ country = ["US"] # 比如下面这个就是 将CN国家的ip 导向自己的grpc节点 #[[route]] -#dialTag = "my_grpc" +#toTag = "my_grpc" #country = ["CN"] # 比如下面这个就是 将CN国家的ip进行直连 #[[route]] -#dialTag = "direct" +#toTag = "direct" #country = ["CN"] # 本示例为了测试节点可用性, 默认将直连的路由注释掉了, 如果你在CN国家并想直连CN的ip, 请取消注释上面三行. 并移除其它路由CN的route项 -# 下面这种 dialTag 传入列表的用法 非常简洁, 可以达到负载均衡的效果, +# 下面这种 toTag 传入列表的用法 非常简洁, 可以达到负载均衡的效果, # 每次路由US国家的流量都会随机从列表中选一项 #[[route]] -#dialTag = ["my_vps1","myvps2"] +#toTag = ["my_vps1","myvps2"] #country = ["US"] @@ -157,11 +157,11 @@ country = ["US"] # 比如这个就是 将CN国家的域名 导向自己的grpc节点 [[route]] -dialTag = "my_grpc" +toTag = "my_grpc" domain = ["geosite:cn"] # 其它匹配: # network = ["tcp","udp"] # 匹配 实际客户数据的 传输层协议 -# inTag = ["tag1","tag2"] # 匹配 来自哪一个 listen 的 tag +# fromTag = ["tag1","tag2"] # 匹配 来自哪一个 listen 的 tag # country = ["CN"] # 匹配 geoip 以及 cn 顶级域名. diff --git a/examples/socks5.toml b/examples/socks5.toml index 5e9f466..87c3d57 100644 --- a/examples/socks5.toml +++ b/examples/socks5.toml @@ -16,8 +16,8 @@ host = "127.0.0.1" port = 10801 [[route]] -inTag = ["my_socks5_1"] -dialTag = "dial1" +fromTag = ["my_socks5_1"] +toTag = "dial1" [[listen]] tag = "my_socks5_2" @@ -30,5 +30,5 @@ tag = "direct" protocol = "direct" [[route]] -inTag = ["my_socks5_2"] -dialTag = "direct" \ No newline at end of file +fromTag = ["my_socks5_2"] +toTag = "direct" \ No newline at end of file diff --git a/examples/vless_v1.server.toml b/examples/vless_v1.server.toml index f0d3214..d1a1f6d 100644 --- a/examples/vless_v1.server.toml +++ b/examples/vless_v1.server.toml @@ -16,5 +16,5 @@ protocol = "direct" # fullcone = true # 默认的fullcone是关闭状态, 可以取消注释以打开 [[route]] -inTag = ["my_vlesss1"] -dialTag = "mydirect" +fromTag = ["my_vlesss1"] +toTag = "mydirect" diff --git a/examples/vlesss.client.toml b/examples/vlesss.client.toml index 8d0e8e5..0236df2 100644 --- a/examples/vlesss.client.toml +++ b/examples/vlesss.client.toml @@ -94,4 +94,4 @@ protocol = "direct" # direct 这个dial 是不需要特地写出的, 程序会 [[route]] country = ["CN"] domain = ["geosite:cn"] -dialTag = "mydirect" +toTag = "mydirect" diff --git a/netLayer/route_conf.go b/netLayer/route_conf.go index f1aad49..be4dfae 100644 --- a/netLayer/route_conf.go +++ b/netLayer/route_conf.go @@ -13,9 +13,9 @@ import ( ) type RuleConf struct { - DialTag any `toml:"dialTag"` + DialTag any `toml:"toTag"` - InTags []string `toml:"inTag"` + InTags []string `toml:"fromTag"` Countries []string `toml:"country"` // 如果类似 !CN, 则意味着专门匹配不为CN 的国家(目前还未实现) IPs []string `toml:"ip"`