|
@@ -212,18 +212,18 @@ start_dns() {
|
|
|
oversea) ipset add oversea $dnsserver 2>/dev/null ;;
|
|
oversea) ipset add oversea $dnsserver 2>/dev/null ;;
|
|
|
*) ipset add ss_spec_wan_ac $dnsserver nomatch 2>/dev/null ;;
|
|
*) ipset add ss_spec_wan_ac $dnsserver nomatch 2>/dev/null ;;
|
|
|
esac
|
|
esac
|
|
|
|
|
+ case "$ssrplus_dns" in
|
|
|
|
|
+ 1)
|
|
|
|
|
+ start_pdnsd $dnsserver $dnsport
|
|
|
|
|
+ pdnsd_enable_flag=1
|
|
|
|
|
+ ;;
|
|
|
|
|
+ 2)
|
|
|
|
|
+ ln_start_bin $(first_type microsocks) microsocks -i 127.0.0.1 -p $tmp_dns_port ssrplus-dns
|
|
|
|
|
+ ln_start_bin $(first_type dns2socks) dns2socks 127.0.0.1:$tmp_dns_port $dnsserver:$dnsport 127.0.0.1:5335 -q
|
|
|
|
|
+ pdnsd_enable_flag=2
|
|
|
|
|
+ ;;
|
|
|
|
|
+ esac
|
|
|
fi
|
|
fi
|
|
|
- case "$ssrplus_dns" in
|
|
|
|
|
- 1)
|
|
|
|
|
- start_pdnsd $dnsserver $dnsport
|
|
|
|
|
- pdnsd_enable_flag=1
|
|
|
|
|
- ;;
|
|
|
|
|
- 2)
|
|
|
|
|
- ln_start_bin $(first_type microsocks) microsocks -i 127.0.0.1 -p $tmp_dns_port ssrplus-dns
|
|
|
|
|
- ln_start_bin $(first_type dns2socks) dns2socks 127.0.0.1:$tmp_dns_port $dnsserver:$dnsport 127.0.0.1:5335 -q
|
|
|
|
|
- pdnsd_enable_flag=2
|
|
|
|
|
- ;;
|
|
|
|
|
- esac
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
gen_service_file() {
|
|
gen_service_file() {
|
|
@@ -363,13 +363,13 @@ start_udp() {
|
|
|
trojan) #client
|
|
trojan) #client
|
|
|
gen_config_file $UDP_RELAY_SERVER $type 2 $tmp_udp_local_port
|
|
gen_config_file $UDP_RELAY_SERVER $type 2 $tmp_udp_local_port
|
|
|
ln_start_bin $(first_type trojan-go trojan) $type --config $udp_config_file
|
|
ln_start_bin $(first_type trojan-go trojan) $type --config $udp_config_file
|
|
|
- ln_start_bin $(first_type ipt2socks-alt ipt2socks) ipt2socks -U -b 0.0.0.0 -4 -s 127.0.0.1 -p $tmp_udp_local_port -l $tmp_udp_port
|
|
|
|
|
|
|
+ ln_start_bin $(first_type ipt2socks) ipt2socks -U -b 0.0.0.0 -4 -s 127.0.0.1 -p $tmp_udp_local_port -l $tmp_udp_port
|
|
|
echolog "UDP TPROXY Relay:$($(first_type trojan-go trojan) --version 2>&1 | head -1) Started!"
|
|
echolog "UDP TPROXY Relay:$($(first_type trojan-go trojan) --version 2>&1 | head -1) Started!"
|
|
|
;;
|
|
;;
|
|
|
trojan-go)
|
|
trojan-go)
|
|
|
gen_config_file $UDP_RELAY_SERVER $type 2 $udp_config_file
|
|
gen_config_file $UDP_RELAY_SERVER $type 2 $udp_config_file
|
|
|
- ln_start_bin $(first_type trojan-go trojan) $type --config $udp_config_file
|
|
|
|
|
- echolog "UDP TPROXY Relay:$($(first_type trojan-go trojan) --version 2>&1 | head -1) Started!"
|
|
|
|
|
|
|
+ ln_start_bin $(first_type trojan-go) $type --config $udp_config_file
|
|
|
|
|
+ echolog "UDP TPROXY Relay:$($(first_type trojan-go) --version 2>&1 | head -1) Started!"
|
|
|
;;
|
|
;;
|
|
|
naiveproxy)
|
|
naiveproxy)
|
|
|
echolog "NaïveProxy UDP TPROXY Relay not supported!"
|
|
echolog "NaïveProxy UDP TPROXY Relay not supported!"
|
|
@@ -380,7 +380,7 @@ start_udp() {
|
|
|
if [ "$(uci_get_by_name $UDP_RELAY_SERVER auth_enable 0)" == "1" ]; then
|
|
if [ "$(uci_get_by_name $UDP_RELAY_SERVER auth_enable 0)" == "1" ]; then
|
|
|
local auth="-a $(uci_get_by_name $UDP_RELAY_SERVER username) -k $(uci_get_by_name $UDP_RELAY_SERVER password)"
|
|
local auth="-a $(uci_get_by_name $UDP_RELAY_SERVER username) -k $(uci_get_by_name $UDP_RELAY_SERVER password)"
|
|
|
fi
|
|
fi
|
|
|
- ln_start_bin $(first_type ipt2socks-alt ipt2socks) ipt2socks $udp_config_file -U -4 -s $(uci_get_by_name $UDP_RELAY_SERVER server) -p $(uci_get_by_name $UDP_RELAY_SERVER server_port) -l $tmp_udp_port $auth
|
|
|
|
|
|
|
+ ln_start_bin $(first_type ipt2socks) ipt2socks $udp_config_file -U -4 -s $(uci_get_by_name $UDP_RELAY_SERVER server) -p $(uci_get_by_name $UDP_RELAY_SERVER server_port) -l $tmp_udp_port $auth
|
|
|
#gen_config_file $UDP_RELAY_SERVER $type 2 $tmp_udp_port
|
|
#gen_config_file $UDP_RELAY_SERVER $type 2 $tmp_udp_port
|
|
|
#ln_start_bin $(first_type redsocks2) redsocks2 -c $udp_config_file
|
|
#ln_start_bin $(first_type redsocks2) redsocks2 -c $udp_config_file
|
|
|
echolog "UDP TPROXY Relay:Socks5 REDIRECT/TPROXY Started!"
|
|
echolog "UDP TPROXY Relay:Socks5 REDIRECT/TPROXY Started!"
|
|
@@ -448,7 +448,7 @@ start_shunt() {
|
|
|
if [ "$(uci_get_by_name $SHUNT_SERVER auth_enable 0)" == "1" ]; then
|
|
if [ "$(uci_get_by_name $SHUNT_SERVER auth_enable 0)" == "1" ]; then
|
|
|
local auth="-a $(uci_get_by_name $SHUNT_SERVER username) -k $(uci_get_by_name $SHUNT_SERVER password)"
|
|
local auth="-a $(uci_get_by_name $SHUNT_SERVER username) -k $(uci_get_by_name $SHUNT_SERVER password)"
|
|
|
fi
|
|
fi
|
|
|
- ln_start_bin $(first_type ipt2socks-alt ipt2socks) ipt2socks $shunt_config_file -R -4 -s $(uci_get_by_name $SHUNT_SERVER server) -p $(uci_get_by_name $SHUNT_SERVER server_port) -l $tmp_shunt_port $auth
|
|
|
|
|
|
|
+ ln_start_bin $(first_type ipt2socks) ipt2socks $shunt_config_file -R -4 -s $(uci_get_by_name $SHUNT_SERVER server) -p $(uci_get_by_name $SHUNT_SERVER server_port) -l $tmp_shunt_port $auth
|
|
|
#gen_config_file $SHUNT_SERVER $type 3 $tmp_shunt_port
|
|
#gen_config_file $SHUNT_SERVER $type 3 $tmp_shunt_port
|
|
|
#ln_start_bin $(first_type redsocks2) redsocks2 -c $shunt_config_file
|
|
#ln_start_bin $(first_type redsocks2) redsocks2 -c $shunt_config_file
|
|
|
if [ -n "$tmp_local_port" ]; then
|
|
if [ -n "$tmp_local_port" ]; then
|
|
@@ -567,7 +567,7 @@ Start_Run() {
|
|
|
if [ "$(uci_get_by_name $GLOBAL_SERVER auth_enable 0)" == "1" ]; then
|
|
if [ "$(uci_get_by_name $GLOBAL_SERVER auth_enable 0)" == "1" ]; then
|
|
|
local auth="-a $(uci_get_by_name $GLOBAL_SERVER username) -k $(uci_get_by_name $GLOBAL_SERVER password)"
|
|
local auth="-a $(uci_get_by_name $GLOBAL_SERVER username) -k $(uci_get_by_name $GLOBAL_SERVER password)"
|
|
|
fi
|
|
fi
|
|
|
- ln_start_bin $(first_type ipt2socks-alt ipt2socks) ipt2socks $tcp_config_file -R -4 -j $threads -s $(uci_get_by_name $GLOBAL_SERVER server) -p $(uci_get_by_name $GLOBAL_SERVER server_port) -l $tcp_port $auth
|
|
|
|
|
|
|
+ ln_start_bin $(first_type ipt2socks) ipt2socks $tcp_config_file -R -4 -j $threads -s $(uci_get_by_name $GLOBAL_SERVER server) -p $(uci_get_by_name $GLOBAL_SERVER server_port) -l $tcp_port $auth
|
|
|
#gen_config_file $GLOBAL_SERVER $type 1 $tcp_port
|
|
#gen_config_file $GLOBAL_SERVER $type 1 $tcp_port
|
|
|
#for i in $(seq 1 $threads); do
|
|
#for i in $(seq 1 $threads); do
|
|
|
# ln_start_bin $(first_type redsocks2) redsocks2 -c $tcp_config_file
|
|
# ln_start_bin $(first_type redsocks2) redsocks2 -c $tcp_config_file
|
|
@@ -603,7 +603,7 @@ load_config() {
|
|
|
nil)
|
|
nil)
|
|
|
mode="tcp"
|
|
mode="tcp"
|
|
|
;;
|
|
;;
|
|
|
- same)
|
|
|
|
|
|
|
+ $GLOBAL_SERVER | same)
|
|
|
mode="tcp,udp"
|
|
mode="tcp,udp"
|
|
|
tcp_config_file=$TMP_PATH/tcp-udp-ssr-retcp.json
|
|
tcp_config_file=$TMP_PATH/tcp-udp-ssr-retcp.json
|
|
|
ARG_UDP="-u"
|
|
ARG_UDP="-u"
|
|
@@ -611,27 +611,20 @@ load_config() {
|
|
|
UDP_RELAY_SERVER=$GLOBAL_SERVER
|
|
UDP_RELAY_SERVER=$GLOBAL_SERVER
|
|
|
;;
|
|
;;
|
|
|
*)
|
|
*)
|
|
|
- if [ "$UDP_RELAY_SERVER" == "$GLOBAL_SERVER" ]; then
|
|
|
|
|
- mode="tcp,udp"
|
|
|
|
|
- tcp_config_file=$TMP_PATH/tcp-udp-ssr-retcp.json
|
|
|
|
|
- ARG_UDP="-u"
|
|
|
|
|
- ARG_OTA="-u"
|
|
|
|
|
- else
|
|
|
|
|
- mode="udp"
|
|
|
|
|
- udp_config_file=$TMP_PATH/udp-only-ssr-reudp.json
|
|
|
|
|
- ARG_UDP="-U"
|
|
|
|
|
- ARG_OTA="-U"
|
|
|
|
|
- start_udp
|
|
|
|
|
- ARG_OTA=""
|
|
|
|
|
- mode="tcp"
|
|
|
|
|
- fi
|
|
|
|
|
|
|
+ mode="udp"
|
|
|
|
|
+ udp_config_file=$TMP_PATH/udp-only-ssr-reudp.json
|
|
|
|
|
+ ARG_UDP="-U"
|
|
|
|
|
+ ARG_OTA="-U"
|
|
|
|
|
+ start_udp
|
|
|
|
|
+ ARG_OTA=""
|
|
|
|
|
+ mode="tcp"
|
|
|
;;
|
|
;;
|
|
|
esac
|
|
esac
|
|
|
case "$LOCAL_SERVER" in
|
|
case "$LOCAL_SERVER" in
|
|
|
nil)
|
|
nil)
|
|
|
_local="0"
|
|
_local="0"
|
|
|
;;
|
|
;;
|
|
|
- same)
|
|
|
|
|
|
|
+ $GLOBAL_SERVER | same)
|
|
|
_local="1"
|
|
_local="1"
|
|
|
LOCAL_SERVER=$GLOBAL_SERVER
|
|
LOCAL_SERVER=$GLOBAL_SERVER
|
|
|
local_config_file=$TMP_PATH/tcp-udp-ssr-local.json
|
|
local_config_file=$TMP_PATH/tcp-udp-ssr-local.json
|
|
@@ -639,35 +632,24 @@ load_config() {
|
|
|
local_enable=0
|
|
local_enable=0
|
|
|
;;
|
|
;;
|
|
|
*)
|
|
*)
|
|
|
- if [ "$LOCAL_SERVER" == "$GLOBAL_SERVER" ]; then
|
|
|
|
|
- _local="1"
|
|
|
|
|
- local_config_file=$TMP_PATH/tcp-udp-ssr-local.json
|
|
|
|
|
- start_local
|
|
|
|
|
- local_enable=0
|
|
|
|
|
- else
|
|
|
|
|
- _local="2"
|
|
|
|
|
- local_config_file=$TMP_PATH/tcp-udp-ssr-local.json
|
|
|
|
|
- start_local
|
|
|
|
|
- fi
|
|
|
|
|
|
|
+ _local="2"
|
|
|
|
|
+ local_config_file=$TMP_PATH/tcp-udp-ssr-local.json
|
|
|
|
|
+ start_local
|
|
|
;;
|
|
;;
|
|
|
esac
|
|
esac
|
|
|
case "$SHUNT_SERVER" in
|
|
case "$SHUNT_SERVER" in
|
|
|
nil)
|
|
nil)
|
|
|
shunt="0"
|
|
shunt="0"
|
|
|
;;
|
|
;;
|
|
|
- same)
|
|
|
|
|
|
|
+ $GLOBAL_SERVER | same)
|
|
|
shunt="1"
|
|
shunt="1"
|
|
|
SHUNT_SERVER=$GLOBAL_SERVER
|
|
SHUNT_SERVER=$GLOBAL_SERVER
|
|
|
;;
|
|
;;
|
|
|
*)
|
|
*)
|
|
|
- if [ "$SHUNT_SERVER" == "$GLOBAL_SERVER" ]; then
|
|
|
|
|
- shunt="1"
|
|
|
|
|
- else
|
|
|
|
|
- shunt="$tmp_shunt_port"
|
|
|
|
|
- shunt_config_file=$TMP_PATH/shunt-ssr-retcp.json
|
|
|
|
|
- shunt_dns_config_file=$TMP_PATH/shunt-dns-ssr-plus.json
|
|
|
|
|
- start_shunt
|
|
|
|
|
- fi
|
|
|
|
|
|
|
+ shunt="$tmp_shunt_port"
|
|
|
|
|
+ shunt_config_file=$TMP_PATH/shunt-ssr-retcp.json
|
|
|
|
|
+ shunt_dns_config_file=$TMP_PATH/shunt-dns-ssr-plus.json
|
|
|
|
|
+ start_shunt
|
|
|
;;
|
|
;;
|
|
|
esac
|
|
esac
|
|
|
return 0
|
|
return 0
|
|
@@ -907,7 +889,7 @@ reset() {
|
|
|
set shadowsocksr.@global[0].switch_try_count='3'
|
|
set shadowsocksr.@global[0].switch_try_count='3'
|
|
|
set shadowsocksr.@global[0].gfwlist_url='https://cdn.jsdelivr.net/gh/YW5vbnltb3Vz/domain-list-community@release/gfwlist.txt'
|
|
set shadowsocksr.@global[0].gfwlist_url='https://cdn.jsdelivr.net/gh/YW5vbnltb3Vz/domain-list-community@release/gfwlist.txt'
|
|
|
set shadowsocksr.@global[0].chnroute_url='https://ispip.clang.cn/all_cn.txt'
|
|
set shadowsocksr.@global[0].chnroute_url='https://ispip.clang.cn/all_cn.txt'
|
|
|
- set shadowsocksr.@global[0].nfip_url='https://cdn.jsdelivr.net/gh/QiuSimons/Netflix_IP/getflix.txt'
|
|
|
|
|
|
|
+ set shadowsocksr.@global[0].nfip_url='https://cdn.jsdelivr.net/gh/QiuSimons/Netflix_IP/NF_only.txt'
|
|
|
set shadowsocksr.@global[0].adblock_url='https://anti-ad.net/anti-ad-for-dnsmasq.conf'
|
|
set shadowsocksr.@global[0].adblock_url='https://anti-ad.net/anti-ad-for-dnsmasq.conf'
|
|
|
add shadowsocksr server_subscribe
|
|
add shadowsocksr server_subscribe
|
|
|
set shadowsocksr.@server_subscribe[0].proxy='0'
|
|
set shadowsocksr.@server_subscribe[0].proxy='0'
|