From 507b5449819d1aafb4b70a604776b8237bbc1cf9 Mon Sep 17 00:00:00 2001 From: dnomd343 Date: Wed, 31 Aug 2022 22:36:12 +0800 Subject: [PATCH] update: change `tproxy` into `tproxy4` --- README.md | 6 ++++-- cmd/proxy/main.go | 2 +- docs/example_1.md | 6 +++--- docs/example_2.md | 18 +++++++++--------- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index eb077b3..e2b82c9 100644 --- a/README.md +++ b/README.md @@ -67,8 +67,8 @@ proxy: http: web: 8080 socks: - proxy: 1094 - direct: 1084 + proxy4: 1094 + direct4: 1084 proxy6: 1096 direct6: 1086 addon: @@ -85,6 +85,8 @@ proxy: - courier.push.apple.com ``` +> 入站代理中内置 `tproxy4` 与 `tproxy6` 两个接口,分别对应 IPv4 与 IPv6 的透明代理,可作为 `inboundTag` 在路由中引用 + + `log` :代理日志级别,可选 `debug` 、`info` 、`warning` 、`error` 、`none` ,默认为 `warning` + `core` :代理内核类型,可选 `xray` 、`v2ray` 、`sagray`,默认为 `xray` diff --git a/cmd/proxy/main.go b/cmd/proxy/main.go index 6f62d3b..6699f44 100644 --- a/cmd/proxy/main.go +++ b/cmd/proxy/main.go @@ -37,7 +37,7 @@ func loadInbounds(config *Config) string { sniff.DestOverride = sniff.DestOverride[:len(sniff.DestOverride)-1] } var inbounds []interface{} - inbounds = append(inbounds, loadTProxyConfig("tproxy", config.V4TProxyPort, sniff)) + inbounds = append(inbounds, loadTProxyConfig("tproxy4", config.V4TProxyPort, sniff)) inbounds = append(inbounds, loadTProxyConfig("tproxy6", config.V6TProxyPort, sniff)) for tag, port := range config.Http { inbounds = append(inbounds, loadHttpConfig(tag, port, sniff)) diff --git a/docs/example_1.md b/docs/example_1.md index 9e66a9b..89592e0 100644 --- a/docs/example_1.md +++ b/docs/example_1.md @@ -120,15 +120,15 @@ custom: "outbounds": [ { "tag": "nodeA", - ··· + "...": "..." }, { "tag": "nodeB", - ··· + "...": "..." }, { "tag": "nodeC", - ··· + "...": "..." }, ] } diff --git a/docs/example_2.md b/docs/example_2.md index c002f68..7ae1434 100644 --- a/docs/example_2.md +++ b/docs/example_2.md @@ -69,8 +69,8 @@ proxy: log: info core: xray socks: - proxy: 1094 - direct: 1084 + proxy4: 1094 + direct4: 1084 proxy6: 1096 direct6: 1086 sniff: @@ -137,11 +137,11 @@ asset: }, { "tag": "proxy4", - ... + "...": "..." }, { "tag": "proxy6", - ... + "...": "..." } ] } @@ -156,7 +156,7 @@ asset: "rules": [ { "type": "field", - "inboundTag": ["direct"], + "inboundTag": ["direct4"], "outboundTag": "direct4" }, { @@ -166,7 +166,7 @@ asset: }, { "type": "field", - "inboundTag": ["proxy"], + "inboundTag": ["proxy4"], "outboundTag": "proxy4" }, { @@ -176,7 +176,7 @@ asset: }, { "type": "field", - "inboundTag": ["tproxy"], + "inboundTag": ["tproxy4"], "domain": ["geosite:cn"], "outboundTag": "direct4" }, @@ -188,7 +188,7 @@ asset: }, { "type": "field", - "inboundTag": ["tproxy"], + "inboundTag": ["tproxy4"], "ip": [ "geoip:cn", "geoip:private" @@ -206,7 +206,7 @@ asset: }, { "type": "field", - "inboundTag": ["tproxy"], + "inboundTag": ["tproxy4"], "outboundTag": "proxy4" }, {