提交 38051053 编写于 作者: C coolsnowwolf

luci ssr plus: add global proxy mode

上级 5913746d
......@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-ssr-plus
PKG_VERSION:=1
PKG_RELEASE:=89
PKG_RELEASE:=90
PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_Shadowsocks \
CONFIG_PACKAGE_$(PKG_NAME)_INCLUDE_V2ray \
......
......@@ -55,6 +55,7 @@ o.rmempty = false
o = s:option(ListValue, "run_mode", translate("Running Mode"))
o:value("gfw", translate("GFW List Mode"))
o:value("router", translate("IP Route Mode"))
o:value("all", translate("Global Mode"))
o:value("oversea", translate("Oversea Mode"))
o.default = gfw
......
......@@ -185,7 +185,7 @@ msgid "Running Status"
msgstr "运行状态"
msgid "Global Client"
msgstr "全局客户端"
msgstr "TCP透明代理"
msgid "Global SSR Server"
msgstr "SSR服务端"
......@@ -226,6 +226,9 @@ msgstr "绕过中国大陆IP模式"
msgid "GFW List Mode"
msgstr "GFW列表模式"
msgid "Global Mode"
msgstr "全局模式"
msgid "Oversea Mode"
msgstr "海外用户回国模式"
......
......@@ -183,6 +183,8 @@ start_rules() {
gfwmode="-r"
elif [ "$run_mode" = "oversea" ]; then
gfwmode="-c"
elif [ "$run_mode" = "all" ]; then
gfwmode="-z"
fi
......
......@@ -101,6 +101,11 @@ EOF
$IPT -A SS_SPEC_WAN_AC -m set --match-set china dst -j SS_SPEC_WAN_FW
$IPT -I SS_SPEC_WAN_AC -d $server -j RETURN
elif [ "$RUNMODE" = "all" ] ;then
$IPT -N SS_SPEC_WAN_AC
$IPT -A SS_SPEC_WAN_AC -j SS_SPEC_WAN_FW
$IPT -I SS_SPEC_WAN_AC -d $server -j RETURN
fi
ipset -N fplan hash:net 2>/dev/null
......@@ -199,6 +204,9 @@ tp_rule() {
elif [ "$RUNMODE" = "oversea" ] ;then
$ipt -A SS_SPEC_TPROXY -p udp -m set --match-set china dst \
-j TPROXY --on-port "$LOCAL_PORT" --tproxy-mark 0x01/0x01
elif [ "$RUNMODE" = "all" ] ;then
$ipt -A SS_SPEC_TPROXY -p udp -j TPROXY --on-port "$LOCAL_PORT" --tproxy-mark 0x01/0x01
fi
$ipt -I PREROUTING 1 ${IFNAME:+-i $IFNAME} -p udp $EXT_ARGS $MATCH_SET \
......@@ -278,7 +286,7 @@ EOF
return 0
}
while getopts ":s:l:S:L:i:e:a:b:w:p:G:oOuUfgrch" arg; do
while getopts ":s:l:S:L:i:e:a:b:w:p:G:oOuUfgrczh" arg; do
case "$arg" in
s)
server=$OPTARG
......@@ -334,6 +342,9 @@ while getopts ":s:l:S:L:i:e:a:b:w:p:G:oOuUfgrch" arg; do
c)
RUNMODE=oversea
;;
z)
RUNMODE=all
;;
f)
flush_r
exit 0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册