From 4753b4213f8bef8a67702edf7dae6bf783926be1 Mon Sep 17 00:00:00 2001 From: Whispering Wind <151555003+ReturnFI@users.noreply.github.com> Date: Sat, 18 Jan 2025 00:00:05 +0330 Subject: [PATCH] Restart Hysteria2 service --- core/scripts/hysteria2/masquerade.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/scripts/hysteria2/masquerade.sh b/core/scripts/hysteria2/masquerade.sh index 4a8e678..38df651 100644 --- a/core/scripts/hysteria2/masquerade.sh +++ b/core/scripts/hysteria2/masquerade.sh @@ -15,11 +15,13 @@ function enable_masquerade() { url="https://$1" jq --arg url "$url" '. + {masquerade: {type: "proxy", proxy: {url: $url, rewriteHost: true}, listenHTTP: ":80", listenHTTPS: ":443", forceHTTPS: true}}' $CONFIG_FILE > tmp.json && mv tmp.json $CONFIG_FILE echo "Masquerade enabled with URL: $url" + python3 "$CLI_PATH" restart-hysteria2 > /dev/null 2>&1 } function remove_masquerade() { jq 'del(.masquerade)' $CONFIG_FILE > tmp.json && mv tmp.json $CONFIG_FILE echo "Masquerade removed from config.json" + python3 "$CLI_PATH" restart-hysteria2 > /dev/null 2>&1 } if [[ "$1" == "1" ]]; then