diff --git a/package/lienol/luci-app-passwall/root/usr/share/passwall/app.sh b/package/lienol/luci-app-passwall/root/usr/share/passwall/app.sh index c60275e949..2c554e88d4 100755 --- a/package/lienol/luci-app-passwall/root/usr/share/passwall/app.sh +++ b/package/lienol/luci-app-passwall/root/usr/share/passwall/app.sh @@ -346,7 +346,7 @@ run_socks() { [ "$protocol" == "wsclient" ] && { [ "$brook_tls" == "1" ] && server_host="wss://${server_host}" || server_host="ws://${server_host}" } - ln_start_bin "$(first_type $(config_t_get global_app brook_file notset) brook)" "brook_socks_$5" "$protocol" -l "$bind:$local_port" -i "$bind" -s "$server_host:$port" -p "$(config_n_get $node password)" + ln_start_bin "$(first_type $(config_t_get global_app brook_file notset) brook)" "brook_socks_$5" "$protocol" --socks5 "$bind:$local_port" -s "$server_host:$port" -p "$(config_n_get $node password)" elif [ "$type" == "ssr" ] || [ "$type" == "ss" ]; then lua $API_GEN_SS $node $local_port > $config_file ln_start_bin "$(first_type ${type}-local)" "${type}-local" -c "$config_file" -b "$bind" -u @@ -401,7 +401,7 @@ run_redir() { if [ "$protocol" == "wsclient" ]; then echolog "Brook的WebSocket不支持UDP转发!" else - ln_start_bin "$(first_type $(config_t_get global_app brook_file notset) brook)" "brook_udp_$6" tproxy -l "0.0.0.0:$local_port" -s "$server_host:$port" -p "$(config_n_get $node password)" + ln_start_bin "$(first_type $(config_t_get global_app brook_file notset) brook)" "brook_udp_$6" tproxy -l ":$local_port" -s "$server_host:$port" -p "$(config_n_get $node password)" fi elif [ "$type" == "ssr" ] || [ "$type" == "ss" ]; then lua $API_GEN_SS $node $local_port > $config_file @@ -474,7 +474,7 @@ run_redir() { if [ "$protocol" == "wsclient" ]; then [ "$brook_tls" == "1" ] && server_ip="wss://${server_ip}" || server_ip="ws://${server_ip}" socks_port=$(get_new_port 2081 tcp) - ln_start_bin "$(first_type $(config_t_get global_app brook_file notset) brook)" "brook_tcp_$6" wsclient -l "127.0.0.1:$socks_port" -i 127.0.0.1 -s "$server_ip:$port" -p "$(config_n_get $node password)" + ln_start_bin "$(first_type $(config_t_get global_app brook_file notset) brook)" "brook_tcp_$6" wsclient --socks5 "127.0.0.1:$socks_port" -s "$server_ip:$port" -p "$(config_n_get $node password)" eval port=\$TCP_REDIR_PORT$6 ln_start_bin "$(first_type ipt2socks)" "ipt2socks_tcp_$6" -T -l "$port" -b 0.0.0.0 -s 127.0.0.1 -p "$socks_port" -R echolog "Brook的WebSocket不支持透明代理,将使用ipt2socks转换透明代理!" @@ -484,7 +484,7 @@ run_redir() { server_ip=127.0.0.1 port=$KCPTUN_REDIR_PORT } - ln_start_bin "$(first_type $(config_t_get global_app brook_file notset) brook)" "brook_tcp_$6" tproxy -l "0.0.0.0:$local_port" -s "$server_ip:$port" -p "$(config_n_get $node password)" + ln_start_bin "$(first_type $(config_t_get global_app brook_file notset) brook)" "brook_tcp_$6" tproxy -l ":$local_port" -s "$server_ip:$port" -p "$(config_n_get $node password)" fi fi fi diff --git a/package/lienol/luci-app-passwall/root/usr/share/passwall/iptables.sh b/package/lienol/luci-app-passwall/root/usr/share/passwall/iptables.sh index d9c8ecf288..586f20d1a4 100755 --- a/package/lienol/luci-app-passwall/root/usr/share/passwall/iptables.sh +++ b/package/lienol/luci-app-passwall/root/usr/share/passwall/iptables.sh @@ -266,13 +266,10 @@ filter_node() { [ "$_ipt" == "6" ] && _ipt=$ip6t_tmp $_ipt -n -L PSW_OUTPUT | grep -q "${address}:${port}" if [ $? -ne 0 ]; then + unset dst_rule local dst_rule=$(REDIRECT 1 MARK) msg2="按规则路由(${msg})" - [ "$_ipt" == "$ipt_m" ] || { - dst_rule=$(REDIRECT $_port) - msg2="套娃使用(${msg}:${port}>>${_port})" - } - [ "$_ipt" == "$ip6t_tmp" ] || { + [ "$_ipt" == "$ipt_m" -o "$_ipt" == "$ip6t_m" ] || { dst_rule=$(REDIRECT $_port) msg2="套娃使用(${msg}:${port}>>${_port})" }