mirror of
https://github.com/itdoginfo/podkop.git
synced 2026-01-30 22:32:49 +03:00
fix: pass outbound tag to security and transport functions for accurate config updates
This commit is contained in:
@@ -76,8 +76,8 @@ sing_box_cf_add_proxy_outbound() {
|
||||
packet_encoding=$(url_get_query_param "$url" "packetEncoding")
|
||||
|
||||
config=$(sing_box_cm_add_vless_outbound "$config" "$tag" "$host" "$port" "$uuid" "$flow" "" "$packet_encoding")
|
||||
config=$(_add_outbound_security "$config" "$url")
|
||||
config=$(_add_outbound_transport "$config" "$url")
|
||||
config=$(_add_outbound_security "$config" "$tag" "$url")
|
||||
config=$(_add_outbound_transport "$config" "$tag" "$url")
|
||||
;;
|
||||
ss)
|
||||
local userinfo tag host port method password udp_over_tcp
|
||||
@@ -117,8 +117,8 @@ sing_box_cf_add_proxy_outbound() {
|
||||
password=$(url_get_userinfo "$url")
|
||||
|
||||
config=$(sing_box_cm_add_trojan_outbound "$config" "$tag" "$host" "$port" "$password")
|
||||
config=$(_add_outbound_security "$config" "$url")
|
||||
config=$(_add_outbound_transport "$config" "$url")
|
||||
config=$(_add_outbound_security "$config" "$tag" "$url")
|
||||
config=$(_add_outbound_transport "$config" "$tag" "$url")
|
||||
;;
|
||||
*)
|
||||
log "Unsupported proxy $scheme type"
|
||||
@@ -131,7 +131,8 @@ sing_box_cf_add_proxy_outbound() {
|
||||
|
||||
_add_outbound_security() {
|
||||
local config="$1"
|
||||
local url="$2"
|
||||
local outbound_tag="$2"
|
||||
local url="$3"
|
||||
|
||||
local security
|
||||
security=$(url_get_query_param "$url" "security")
|
||||
@@ -148,7 +149,7 @@ _add_outbound_security() {
|
||||
config=$(
|
||||
sing_box_cm_set_tls_for_outbound \
|
||||
"$config" \
|
||||
"$tag" \
|
||||
"$outbound_tag" \
|
||||
"$sni" \
|
||||
"$([ "$insecure" == "1" ] && echo true)" \
|
||||
"$([ "$alpn" == "[]" ] && echo null || echo "$alpn")" \
|
||||
@@ -168,7 +169,8 @@ _add_outbound_security() {
|
||||
|
||||
_add_outbound_transport() {
|
||||
local config="$1"
|
||||
local url="$2"
|
||||
local outbound_tag="$2"
|
||||
local url="$3"
|
||||
|
||||
local transport
|
||||
transport=$(url_get_query_param "$url" "type")
|
||||
@@ -180,11 +182,13 @@ _add_outbound_transport() {
|
||||
ws_host=$(url_get_query_param "$url" "host")
|
||||
ws_early_data=$(url_get_query_param "$url" "ed")
|
||||
|
||||
config=$(sing_box_cm_set_ws_transport_for_outbound "$config" "$tag" "$ws_path" "$ws_host" "$ws_early_data")
|
||||
config=$(
|
||||
sing_box_cm_set_ws_transport_for_outbound "$config" "$outbound_tag" "$ws_path" "$ws_host" "$ws_early_data"
|
||||
)
|
||||
;;
|
||||
grpc)
|
||||
# TODO(ampetelin): Add handling of optional gRPC parameters; example links are needed.
|
||||
config=$(sing_box_cm_set_grpc_transport_for_outbound "$config" "$tag")
|
||||
config=$(sing_box_cm_set_grpc_transport_for_outbound "$config" "$outbound_tag")
|
||||
;;
|
||||
*)
|
||||
log "Unknown transport '$transport' detected." "error"
|
||||
|
||||
Reference in New Issue
Block a user