mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-11-02 03:43:56 +08:00
update 2026-08-11 16:47:57
This commit is contained in:
1 parent
c63c46f0ce
commit
903417940c
1954 files changed
+1523037
-30
No files matched your search
@@ -407,7 +407,7 @@ run_socks() {
|
||||
fi
|
||||
[ "$http_port" != "0" ] && {
|
||||
http_flag=1
|
||||
config_file="${config_file//SOCKS/HTTP_SOCKS}"
|
||||
config_file="${config_file%%.*}+http${config_file#${config_file%%.*}}"
|
||||
json_add_string "local_http_address" "$bind"
|
||||
json_add_string "local_http_port" "$http_port"
|
||||
}
|
||||
@@ -438,7 +438,7 @@ run_socks() {
|
||||
sing-box)
|
||||
[ "$http_port" != "0" ] && {
|
||||
http_flag=1
|
||||
config_file="${config_file//SOCKS/HTTP_SOCKS}"
|
||||
config_file="${config_file%%.*}+http${config_file#${config_file%%.*}}"
|
||||
local _args="http_address=$bind http_port=$http_port"
|
||||
}
|
||||
[ -n "$relay_port" ] && _args="${_args} server_host=$server_host server_port=$server_port"
|
||||
@@ -448,7 +448,7 @@ run_socks() {
|
||||
xray)
|
||||
[ "$http_port" != "0" ] && {
|
||||
http_flag=1
|
||||
config_file="${config_file//SOCKS/HTTP_SOCKS}"
|
||||
config_file="${config_file%%.*}+http${config_file#${config_file%%.*}}"
|
||||
local _args="http_address=$bind http_port=$http_port"
|
||||
}
|
||||
[ -n "$relay_port" ] && _args="${_args} server_host=$server_host server_port=$server_port"
|
||||
@@ -471,7 +471,7 @@ run_socks() {
|
||||
ss-rust)
|
||||
[ "$http_port" != "0" ] && {
|
||||
http_flag=1
|
||||
config_file="${config_file//SOCKS/HTTP_SOCKS}"
|
||||
config_file="${config_file%%.*}+http${config_file#${config_file%%.*}}"
|
||||
json_add_string "local_http_address" "$bind"
|
||||
json_add_string "local_http_port" "$http_port"
|
||||
}
|
||||
@@ -487,7 +487,7 @@ run_socks() {
|
||||
hysteria2)
|
||||
[ "$http_port" != "0" ] && {
|
||||
http_flag=1
|
||||
config_file="${config_file//SOCKS/HTTP_SOCKS}"
|
||||
config_file="${config_file%%.*}+http${config_file#${config_file%%.*}}"
|
||||
json_add_string "local_http_address" "$bind"
|
||||
json_add_string "local_http_port" "$http_port"
|
||||
}
|
||||
@@ -1003,7 +1003,7 @@ start_socks() {
|
||||
local log=$(config_n_get $id log 1)
|
||||
[ "$log" = "0" ] && log_file=""
|
||||
local http_port=$(config_n_get $id http_port 0)
|
||||
local http_config_file="HTTP2SOCKS_${id}.json"
|
||||
local http_config_file="${flag}_http.json"
|
||||
local enable_autoswitch=$(config_n_get $id enable_autoswitch 0)
|
||||
local no_rec=0
|
||||
[ "$enable_autoswitch" = "1" ] && no_rec=1
|
||||
@@ -1020,16 +1020,16 @@ socks_node_switch() {
|
||||
local flag new_node
|
||||
eval_set_val "$@"
|
||||
[ -n "$flag" ] && [ -n "$new_node" ] && {
|
||||
local prefix pf filename
|
||||
local suffix pf filename
|
||||
# 结束 SS 插件进程
|
||||
for prefix in "" "HTTP_"; do
|
||||
pf="$TMP_PATH/${prefix}${flag}_plugin.pid"
|
||||
for suffix in "" "+http"; do
|
||||
pf="$TMP_PATH/${flag}${suffix}_plugin.pid"
|
||||
[ -s "$pf" ] && kill -9 "$(head -n1 "$pf")" >/dev/null 2>&1
|
||||
done
|
||||
|
||||
busybox pgrep -af "$TMP_BIN_PATH" | awk -v P1="${flag}" 'BEGIN{IGNORECASE=1}$0~P1 && !/acl\/|acl_/{print $1}' | xargs kill -9 >/dev/null 2>&1
|
||||
for prefix in "" "HTTP_" "HTTP2"; do
|
||||
rm -rf "$TMP_PATH/${prefix}${flag}"*
|
||||
for suffix in "" "+http" "_http"; do
|
||||
rm -rf "$TMP_PATH/${flag}${suffix}"*
|
||||
done
|
||||
|
||||
for filename in $(ls ${TMP_SCRIPT_FUNC_PATH}); do
|
||||
@@ -1045,7 +1045,7 @@ socks_node_switch() {
|
||||
local log=$(config_n_get $flag log 1)
|
||||
[ "$log" = "0" ] && log_file=""
|
||||
local http_port=$(config_n_get $flag http_port 0)
|
||||
local http_config_file="HTTP2SOCKS_${flag}.json"
|
||||
local http_config_file="${flag}_http.json"
|
||||
LOG_FILE="/dev/null"
|
||||
run_socks flag=$flag node=$new_node bind=$bind socks_port=$port config_file=$config_file http_port=$http_port http_config_file=$http_config_file log_file=$log_file
|
||||
set_cache_var "${flag}" "$new_node"
|
||||
|
||||
Reference in new issue
Block a user