mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 04:13:31 +00:00
luci-app-ssr-plus: add external 'proxy in proxy mode' support
This commit is contained in:
parent
f624769afe
commit
3d3f812eb0
@ -1,8 +1,8 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-ssr-plus
|
||||
PKG_VERSION:=170
|
||||
PKG_RELEASE:=5
|
||||
PKG_VERSION:=171
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
|
@ -49,6 +49,11 @@ for _,key in pairs(key_table) do o:value(key,server_table[key]) end
|
||||
o.default = "same"
|
||||
o.rmempty = false
|
||||
|
||||
o = s:option(Flag, "netflix_proxy", translate("External Proxy Mode"))
|
||||
o.rmempty = false
|
||||
o.description = translate("Forward Netflix Proxy through Main Proxy")
|
||||
o.default="0"
|
||||
|
||||
o = s:option(ListValue, "threads", translate("Multi Threads Option"))
|
||||
o:value("0", translate("Auto Threads"))
|
||||
o:value("1", translate("1 Thread"))
|
||||
|
@ -660,3 +660,9 @@ msgstr "Netflix 分流域名列表"
|
||||
|
||||
msgid "Netflix IP List"
|
||||
msgstr "Netflix 分流IP列表"
|
||||
|
||||
msgid "External Proxy Mode"
|
||||
msgstr "分流服务器套娃模式"
|
||||
|
||||
msgid "Forward Netflix Proxy through Main Proxy"
|
||||
msgstr "分流服务器流量通过主服务节点(前置)中转代理转发"
|
||||
|
@ -228,6 +228,7 @@ start_rules() {
|
||||
else
|
||||
netflix="0"
|
||||
fi
|
||||
netflix_ip=$(check_host $(uci_get_by_name $NETFLIX_SERVER server))
|
||||
/usr/bin/ssr-rules \
|
||||
-s "$server" \
|
||||
-l "$local_port" \
|
||||
@ -242,6 +243,8 @@ start_rules() {
|
||||
-G "$(uci_get_by_type access_control lan_gm_ips)" \
|
||||
-D "$proxyport" \
|
||||
-F "$netflix" \
|
||||
-N "$netflix_ip" \
|
||||
-M "$(uci_get_by_type global netflix_proxy 0)" \
|
||||
$(get_arg_out) $gfwmode $ARG_UDP
|
||||
return $?
|
||||
}
|
||||
@ -643,8 +646,6 @@ start() {
|
||||
do
|
||||
ipset add netflix $nip 2>/dev/null
|
||||
done
|
||||
|
||||
ipset add ss_spec_wan_ac $(check_host $(uci_get_by_name $NETFLIX_SERVER server)) 2>/dev/null
|
||||
else
|
||||
rm -f /tmp/dnsmasq.ssr/netflix_forward.conf
|
||||
fi
|
||||
|
@ -119,10 +119,16 @@ ipset_r() {
|
||||
$IPT -I SS_SPEC_WAN_AC -m set --match-set whitelist dst -j RETURN
|
||||
for ip in $WAN_BP_IP; do ipset -! add whitelist $ip; done
|
||||
for ip in $WAN_FW_IP; do ipset -! add blacklist $ip; done
|
||||
|
||||
|
||||
if [ "$NETFLIX" == "1" ]; then
|
||||
$IPT -I SS_SPEC_WAN_AC -p tcp -m set --match-set netflix dst -j REDIRECT --to-ports 4321
|
||||
if [ "$NETFLIX_PROXY" == "1" ]; then
|
||||
$IPT -I SS_SPEC_WAN_AC -p tcp -d $NETFLIX_IP -j REDIRECT --to-ports $local_port
|
||||
else
|
||||
ipset -! add ss_spec_wan_ac $NETFLIX_IP
|
||||
fi
|
||||
fi
|
||||
|
||||
return $?
|
||||
}
|
||||
|
||||
@ -296,7 +302,7 @@ gen_include() {
|
||||
return 0
|
||||
}
|
||||
|
||||
while getopts ":s:l:S:L:i:e:a:B:b:w:p:G:D:F:oOuUfgrczh" arg; do
|
||||
while getopts ":s:l:S:L:i:e:a:B:b:w:p:G:D:F:N:M:oOuUfgrczh" arg; do
|
||||
case "$arg" in
|
||||
s)
|
||||
server=$OPTARG
|
||||
@ -340,6 +346,12 @@ while getopts ":s:l:S:L:i:e:a:B:b:w:p:G:D:F:oOuUfgrczh" arg; do
|
||||
F)
|
||||
NETFLIX=$OPTARG
|
||||
;;
|
||||
N)
|
||||
NETFLIX_IP=$OPTARG
|
||||
;;
|
||||
M)
|
||||
NETFLIX_PROXY=$OPTARG
|
||||
;;
|
||||
o)
|
||||
OUTPUT=1
|
||||
;;
|
||||
|
Loading…
Reference in New Issue
Block a user