|
|
@@ -283,7 +283,7 @@ gen_config_file() { #server1 type2 code3 local_port4 socks_port5 threads5
|
|
|
v2ray)
|
|
|
lua /usr/share/shadowsocksr/gen_config.lua $1 $mode $4 $5 >$config_file
|
|
|
;;
|
|
|
- trojan | trojan-go)
|
|
|
+ trojan)
|
|
|
case "$3" in
|
|
|
1)
|
|
|
lua /usr/share/shadowsocksr/gen_config.lua $1 nat $4 >$config_file
|
|
|
@@ -295,7 +295,20 @@ gen_config_file() { #server1 type2 code3 local_port4 socks_port5 threads5
|
|
|
lua /usr/share/shadowsocksr/gen_config.lua $1 client $tmp_port >$shunt_dns_config_file
|
|
|
;;
|
|
|
4)
|
|
|
- lua /usr/share/shadowsocksr/gen_config.lua $1 $mode $4 >$config_file
|
|
|
+ lua /usr/share/shadowsocksr/gen_config.lua $1 client $4 >$config_file
|
|
|
+ ;;
|
|
|
+ esac
|
|
|
+ ;;
|
|
|
+ trojan-go)
|
|
|
+ case "$3" in
|
|
|
+ 1 | 2)
|
|
|
+ lua /usr/share/shadowsocksr/gen_config.lua $1 nat $4 >$config_file
|
|
|
+ ;;
|
|
|
+ 3)
|
|
|
+ lua /usr/share/shadowsocksr/gen_config.lua $1 client $tmp_port >$shunt_dns_config_file
|
|
|
+ ;;
|
|
|
+ 4)
|
|
|
+ lua /usr/share/shadowsocksr/gen_config.lua $1 client $4 >$config_file
|
|
|
;;
|
|
|
esac
|
|
|
;;
|
|
|
@@ -342,12 +355,17 @@ start_udp() {
|
|
|
ln_start_bin $(first_type xray v2ray) v2ray -config $udp_config_file
|
|
|
echolog "UDP TPROXY Relay:$($(first_type "xray" "v2ray") -version | head -1) Started!"
|
|
|
;;
|
|
|
- trojan | trojan-go) #client
|
|
|
+ trojan) #client
|
|
|
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 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!"
|
|
|
;;
|
|
|
+ trojan-go)
|
|
|
+ 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!"
|
|
|
+ ;;
|
|
|
naiveproxy)
|
|
|
echolog "NaïveProxy UDP TPROXY Relay not supported!"
|
|
|
redir_udp=0
|
|
|
@@ -445,7 +463,7 @@ start_local() {
|
|
|
echolog "Global_Socks5:$(get_name $type) Started!"
|
|
|
;;
|
|
|
v2ray)
|
|
|
- if [ "_local" == "1" ]; then
|
|
|
+ if [ "$_local" == "2" ]; then
|
|
|
gen_config_file $LOCAL_SERVER $type 4 0 $local_port
|
|
|
ln_start_bin $(first_type xray v2ray) v2ray -config $local_config_file
|
|
|
echolog "Global_Socks5:$($(first_type "xray" "v2ray") -version | head -1) Started!"
|
|
|
@@ -617,7 +635,7 @@ load_config() {
|
|
|
if [ "$SHUNT_SERVER" == "$GLOBAL_SERVER" ]; then
|
|
|
shunt="1"
|
|
|
else
|
|
|
- shunt="$tmp_shunt_dns_port"
|
|
|
+ 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
|