luci: use v2fly version 5 fixup

This commit is contained in:
xiaorouji 2022-04-15 14:18:17 +08:00 committed by sbwml
parent a1ba938881
commit 9c7e338df0
2 changed files with 6 additions and 7 deletions

View File

@ -123,10 +123,10 @@ local function start()
bin = ln_run("/usr/bin/" .. type .. "-server", type .. "-server", "-c " .. config_file .. " " .. udp_param, log_path) bin = ln_run("/usr/bin/" .. type .. "-server", type .. "-server", "-c " .. config_file .. " " .. udp_param, log_path)
elseif type == "V2ray" then elseif type == "V2ray" then
config = require(require_dir .. "v2ray").gen_config(user) config = require(require_dir .. "v2ray").gen_config(user)
bin = ln_run(api.get_v2ray_path(), "v2ray", "run -config=" .. config_file, log_path) bin = ln_run(api.get_v2ray_path(), "v2ray", "run -c " .. config_file, log_path)
elseif type == "Xray" then elseif type == "Xray" then
config = require(require_dir .. "v2ray").gen_config(user) config = require(require_dir .. "v2ray").gen_config(user)
bin = ln_run(api.get_xray_path(), "xray", "-config=" .. config_file, log_path) bin = ln_run(api.get_xray_path(), "xray", "run -c " .. config_file, log_path)
elseif type == "Trojan" then elseif type == "Trojan" then
config = require(require_dir .. "trojan").gen_config(user) config = require(require_dir .. "trojan").gen_config(user)
bin = ln_run("/usr/sbin/trojan", "trojan", "-c " .. config_file, log_path) bin = ln_run("/usr/sbin/trojan", "trojan", "-c " .. config_file, log_path)

View File

@ -353,8 +353,7 @@ run_v2ray() {
_extra_param="${_extra_param} -tcp_proxy_way $tcp_proxy_way" _extra_param="${_extra_param} -tcp_proxy_way $tcp_proxy_way"
_extra_param="${_extra_param} -loglevel $loglevel" _extra_param="${_extra_param} -loglevel $loglevel"
lua $API_GEN_V2RAY ${_extra_param} > $config_file lua $API_GEN_V2RAY ${_extra_param} > $config_file
[ "$type" = "xray" ] && ln_run "$(first_type $(config_t_get global_app ${type}_file) ${type})" ${type} $log_file -config="$config_file" ln_run "$(first_type $(config_t_get global_app ${type}_file) ${type})" ${type} $log_file run -c "$config_file"
[ "$type" = "v2ray" ] && ln_run "$(first_type $(config_t_get global_app ${type}_file) ${type})" ${type} $log_file run -config="$config_file"
} }
run_dns2socks() { run_dns2socks() {
@ -437,8 +436,7 @@ run_socks() {
local _extra_param="-local_http_port $http_port" local _extra_param="-local_http_port $http_port"
} }
lua $API_GEN_V2RAY_PROTO -local_socks_port $socks_port ${_extra_param} -server_proto socks -server_address ${_socks_address} -server_port ${_socks_port} -server_username ${_socks_username} -server_password ${_socks_password} > $config_file lua $API_GEN_V2RAY_PROTO -local_socks_port $socks_port ${_extra_param} -server_proto socks -server_address ${_socks_address} -server_port ${_socks_port} -server_username ${_socks_username} -server_password ${_socks_password} > $config_file
[ "$type" = "xray" ] && ln_run "$bin" $type $log_file -config="$config_file" ln_run "$bin" $type $log_file run -c "$config_file"
[ "$type" = "v2ray" ] && ln_run "$bin" $type $log_file run -config="$config_file"
;; ;;
v2ray|\ v2ray|\
xray) xray)
@ -515,8 +513,9 @@ run_socks() {
fi fi
[ -z "$type" ] && return 1 [ -z "$type" ] && return 1
lua $API_GEN_V2RAY_PROTO -local_http_port $http_port -server_proto socks -server_address "127.0.0.1" -server_port $socks_port -server_username $_username -server_password $_password > $http_config_file lua $API_GEN_V2RAY_PROTO -local_http_port $http_port -server_proto socks -server_address "127.0.0.1" -server_port $socks_port -server_username $_username -server_password $_password > $http_config_file
ln_run "$bin" ${type} /dev/null -config="$http_config_file" ln_run "$bin" ${type} /dev/null run -c "$http_config_file"
} }
unset http_flag
} }
run_redir() { run_redir() {