luci-app-ssr-plus: fix Netflix unblock in GFWlist mode

This commit is contained in:
lean 2020-03-17 10:54:17 +08:00
parent a19d43e071
commit bd763fb4fb
3 changed files with 12 additions and 8 deletions

View File

@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-ssr-plus
PKG_VERSION:=168
PKG_RELEASE:=5
PKG_RELEASE:=6
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)

View File

@ -108,11 +108,15 @@ gen_config_file() {
}
EOF
local plugin=$(uci_get_by_name $1 plugin)
if [ -n "$plugin" ] && [ "$plugin" == "simple-obfs" ]; then
plugin="obfs-local"
fi
if [ -n "$plugin" -a -x "/usr/bin/$plugin" ]; then
sed -i "s@$hostip\",@$hostip\",\n\"plugin\": \"$plugin\",\n\"plugin_opts\": \"$(uci_get_by_name $1 plugin_opts)\",@" $config_file
if [ -n "$plugin" ]; then
if [ "$plugin" == "simple-obfs" ]; then
plugin="obfs-local"
fi
if [ -x "/usr/bin/$plugin" ]; then
sed -i "s@$hostip\",@$hostip\",\n\"plugin\": \"$plugin\",\n\"plugin_opts\": \"$(uci_get_by_name $1 plugin_opts)\",@" $config_file
else
echo "$(date "+%Y-%m-%d %H:%M:%S") Warning!!! SIP003 plugin $plugin not found!!!" >>/tmp/ssrplus.log
fi
fi
elif [ "$stype" == "ssr" ]; then
cat <<-EOF >$config_file

View File

@ -71,7 +71,6 @@ flush_r() {
ipset -X oversea 2>/dev/null
ipset -X whitelist 2>/dev/null
ipset -X blacklist 2>/dev/null
ipset -X netflix 2>/dev/null
[ -n "$FWI" ] && echo '#!/bin/sh' >$FWI
return 0
}
@ -120,6 +119,8 @@ 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
$IPT -I SS_SPEC_WAN_AC -p tcp -m set --match-set netflix dst -j REDIRECT --to-ports 4321
return $?
}
@ -134,7 +135,6 @@ fw_rule() {
$IPT -A SS_SPEC_WAN_FW -d 192.168.0.0/16 -j RETURN
$IPT -A SS_SPEC_WAN_FW -d 224.0.0.0/4 -j RETURN
$IPT -A SS_SPEC_WAN_FW -d 240.0.0.0/4 -j RETURN
$IPT -A SS_SPEC_WAN_FW -p tcp -m set --match-set netflix dst -j REDIRECT --to-ports 4321
$IPT -A SS_SPEC_WAN_FW -p tcp $PROXY_PORTS \
-j REDIRECT --to-ports $local_port 2>/dev/null || {
loger 3 "Can't redirect, please check the iptables."