diff --git a/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_hysteria.lua b/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_hysteria.lua index 11d9d643c..8ea4f17db 100644 --- a/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_hysteria.lua +++ b/luci-app-passwall/luasrc/model/cbi/passwall/api/gen_hysteria.lua @@ -19,6 +19,7 @@ local local_http_address = var["-local_http_address"] or "0.0.0.0" local local_http_port = var["-local_http_port"] local local_http_username = var["-local_http_username"] local local_http_password = var["-local_http_password"] +local tcp_proxy_way = var["-tcp_proxy_way"] local server_host = var["-server_host"] or node.address local server_port = var["-server_port"] or node.port @@ -57,7 +58,11 @@ local config = { user = (local_http_username and local_http_password) and local_http_username, password = (local_http_username and local_http_password) and local_http_password, } or nil, - tproxy_tcp = (local_tcp_redir_port) and { + redirect_tcp = ("redirect" == tcp_proxy_way and local_tcp_redir_port) and { + listen = "0.0.0.0:" .. local_tcp_redir_port, + timeout = 300 + } or nil, + tproxy_tcp = ("tproxy" == tcp_proxy_way and local_tcp_redir_port) and { listen = "0.0.0.0:" .. local_tcp_redir_port, timeout = 300 } or nil, diff --git a/luci-app-passwall/root/usr/share/passwall/app.sh b/luci-app-passwall/root/usr/share/passwall/app.sh index 096727c5d..6e63a53d8 100755 --- a/luci-app-passwall/root/usr/share/passwall/app.sh +++ b/luci-app-passwall/root/usr/share/passwall/app.sh @@ -796,6 +796,7 @@ run_redir() { UDP_NODE="nil" _extra_param="${_extra_param} -local_udp_redir_port $local_port" } + _extra_param="${_extra_param} -tcp_proxy_way $tcp_proxy_way" lua $API_GEN_HYSTERIA -node $node ${_extra_param} > $config_file ln_run "$(first_type $(config_t_get global_app hysteria_file))" "hysteria" $log_file -c "$config_file" client ;; @@ -1398,8 +1399,8 @@ TCP_UDP=0 [ "$TCP_NODE" == "nil" -a "$UDP_NODE" == "nil" ] && NO_PROXY=1 [ "$(config_get_type $TCP_NODE nil)" == "nil" -a "$(config_get_type $UDP_NODE nil)" == "nil" ] && NO_PROXY=1 tcp_proxy_way=$(config_t_get global_forwarding tcp_proxy_way redirect) -REDIRECT_LIST="socks ss ss-rust ssr v2ray xray trojan-plus trojan-go naiveproxy" -TPROXY_LIST="socks ss ss-rust ssr v2ray xray trojan-plus brook trojan-go hysteria" +REDIRECT_LIST="socks ss ss-rust ssr v2ray xray trojan-go trojan-plus naiveproxy hysteria" +TPROXY_LIST="brook socks ss ss-rust ssr v2ray xray trojan-go trojan-plus hysteria" RESOLVFILE=/tmp/resolv.conf.d/resolv.conf.auto [ -f "${RESOLVFILE}" ] && [ -s "${RESOLVFILE}" ] || RESOLVFILE=/tmp/resolv.conf.auto TCP_REDIR_PORTS=$(config_t_get global_forwarding tcp_redir_ports '80,443')