luci: support hysteria TCP redirect mode
Hysteria support TCP redirect mode now, let's support and directly use it.
This commit is contained in:
parent
cd9320b825
commit
77520259be
@ -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_port = var["-local_http_port"]
|
||||||
local local_http_username = var["-local_http_username"]
|
local local_http_username = var["-local_http_username"]
|
||||||
local local_http_password = var["-local_http_password"]
|
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_host = var["-server_host"] or node.address
|
||||||
local server_port = var["-server_port"] or node.port
|
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,
|
user = (local_http_username and local_http_password) and local_http_username,
|
||||||
password = (local_http_username and local_http_password) and local_http_password,
|
password = (local_http_username and local_http_password) and local_http_password,
|
||||||
} or nil,
|
} 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,
|
listen = "0.0.0.0:" .. local_tcp_redir_port,
|
||||||
timeout = 300
|
timeout = 300
|
||||||
} or nil,
|
} or nil,
|
||||||
|
@ -796,6 +796,7 @@ run_redir() {
|
|||||||
UDP_NODE="nil"
|
UDP_NODE="nil"
|
||||||
_extra_param="${_extra_param} -local_udp_redir_port $local_port"
|
_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
|
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
|
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
|
[ "$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
|
[ "$(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)
|
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"
|
REDIRECT_LIST="socks ss ss-rust ssr v2ray xray trojan-go trojan-plus naiveproxy hysteria"
|
||||||
TPROXY_LIST="socks ss ss-rust ssr v2ray xray trojan-plus brook trojan-go hysteria"
|
TPROXY_LIST="brook socks ss ss-rust ssr v2ray xray trojan-go trojan-plus hysteria"
|
||||||
RESOLVFILE=/tmp/resolv.conf.d/resolv.conf.auto
|
RESOLVFILE=/tmp/resolv.conf.d/resolv.conf.auto
|
||||||
[ -f "${RESOLVFILE}" ] && [ -s "${RESOLVFILE}" ] || RESOLVFILE=/tmp/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')
|
TCP_REDIR_PORTS=$(config_t_get global_forwarding tcp_redir_ports '80,443')
|
||||||
|
Loading…
Reference in New Issue
Block a user