From b8e574c7734892143e59deba354b9f7e8dcac19a Mon Sep 17 00:00:00 2001 From: Samuel Huang Date: Sat, 28 Aug 2021 11:28:21 +1000 Subject: [PATCH] Rename --ignore --direct --- README.md | 8 ++++---- run.sh | 18 +++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 15f9e46..c783ef5 100644 --- a/README.md +++ b/README.md @@ -32,11 +32,11 @@ $ docker run --rm samuelhbne/proxy-xray proxy-xray -i|--stdin [Optional] Read config from stdin instead of auto generation -d|--debug [Optional] Start in debug mode with verbose output - --ignore-china [Optional] Add routing rules to avoid domain and ip located in China being proxied - --ignore-domain [Optional] Add a non-proxy routing rule for domain, like sina.cn or geosite:geosite:geolocation-cn - --ignore-ip [Optional] Add a non-proxy routing rule for ip, like 1.1.1.1/32 or geoip:cn + --direct-china [Optional] Add routing rules to avoid domain and ip located in China being proxied + --direct-domain [Optional] Add a direct routing rule for domain, likegeosite:geosite:geolocation-cn + --direct-ip [Optional] Add a direct routing rule for ip, like geoip:cn --proxy-domain [Optional] Add a proxy routing rule for domain, like twitter.com or geosite:google-cn - --proxy-ip [Optional] Add a proxy routing rule for ip, like geoip:netflix + --proxy-ip [Optional] Add a proxy routing rule for ip, like 1.1.1.1/32 or geoip:netflix --block-domain [Optional] Add a block routing rule for domain, like geosite:category-ads-all --block-ip [Optional] Add a block routing rule for ip, like geoip:private --ltx id@host:port diff --git a/run.sh b/run.sh index 7a64396..e649ca9 100755 --- a/run.sh +++ b/run.sh @@ -8,11 +8,11 @@ usage() { echo "proxy-xray " echo " -i|--stdin [Optional] Read config from stdin instead of auto generation" echo " -d|--debug [Optional] Start in debug mode with verbose output" - echo " --ignore-china [Optional] Add routing rules to avoid domain and ip located in China being proxied" - echo " --ignore-domain [Optional] Add a non-proxy routing rule for domain, like sina.cn or geosite:geosite:geolocation-cn" - echo " --ignore-ip [Optional] Add a non-proxy routing rule for ip, like 1.1.1.1/32 or geoip:cn" + echo " --direct-china [Optional] Add routing rules to avoid domain and ip located in China being proxied" + echo " --direct-domain [Optional] Add a direct routing rule for domain, likegeosite:geosite:geolocation-cn" + echo " --direct-ip [Optional] Add a direct routing rule for ip, like geoip:cn" echo " --proxy-domain [Optional] Add a proxy routing rule for domain, like twitter.com or geosite:google-cn" - echo " --proxy-ip [Optional] Add a proxy routing rule for ip, like geoip:netflix" + echo " --proxy-ip [Optional] Add a proxy routing rule for ip, like 1.1.1.1/32 or geoip:netflix" echo " --block-domain [Optional] Add a block routing rule for domain, like geosite:category-ads-all" echo " --block-ip [Optional] Add a block routing rule for ip, like geoip:private" echo " --ltx id@host:port" @@ -30,7 +30,7 @@ usage() { Jrules='{"rules":[]}' -TEMP=`getopt -o di --long ltx:,ltt:,lttw:,lttg:,mtt:,mttw:,ttt:,tttw:,ssa:,sst:,ignore-domain:,ignore-ip:,ignore-china,proxy-domain:,proxy-ip:,block-domain:,block-ip:,stdin,debug -n "$0" -- $@` +TEMP=`getopt -o di --long ltx:,ltt:,lttw:,lttg:,mtt:,mttw:,ttt:,tttw:,ssa:,sst:,direct-domain:,direct-ip:,direct-china,proxy-domain:,proxy-ip:,block-domain:,block-ip:,stdin,debug -n "$0" -- $@` if [ $? != 0 ] ; then usage; exit 1 ; fi eval set -- "$TEMP" @@ -47,17 +47,17 @@ while true ; do fi shift 2 ;; - --ignore-domain) + --direct-domain) Jrules=`echo "${Jrules}" | jq --arg igndomain "$2" \ '.rules += [{"type":"field", "outboundTag":"direct", "domain":[$igndomain]}]'` shift 2 ;; - --ignore-ip) + --direct-ip) Jrules=`echo "${Jrules}" | jq --arg ignip "$2" \ '.rules += [{"type":"field", "outboundTag":"direct", "ip":[$ignip]}]'` shift 2 ;; - --ignore-china) + --direct-china) Jrules=`echo "${Jrules}" | jq --arg igndomain "geosite:apple-cn" \ '.rules += [{"type":"field", "outboundTag":"direct", "domain":[$igndomain]}]'` Jrules=`echo "${Jrules}" | jq --arg igndomain "geosite:geolocation-cn" \ @@ -132,5 +132,5 @@ if [ "${DEBUG}" = "1" ]; then cat $XCONF fi -exec /usr/local/bin/xray -c $XCONF +#exec /usr/local/bin/xray -c $XCONF