From f156301d9c80125307d51d0607957154669080ce Mon Sep 17 00:00:00 2001 From: chauncey <23046078+ellermister@users.noreply.github.com> Date: Sat, 6 Apr 2024 03:01:03 +0800 Subject: [PATCH] Fix mtg startup failure in due to the error in obtaining the public ip --- mtproxy.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mtproxy.sh b/mtproxy.sh index 04250e6..74b18cc 100644 --- a/mtproxy.sh +++ b/mtproxy.sh @@ -424,10 +424,11 @@ function get_run_command(){ domain_hex=$(str_to_hex $domain) client_secret="ee${secret}${domain_hex}" local local_ip=$(get_local_ip) + public_ip=$(get_ip_public) # ./mtg simple-run -n 1.1.1.1 -t 30s -a 512kib 0.0.0.0:$port $client_secret >/dev/null 2>&1 & [[ -f "./mtg" ]] || (echo -e "提醒:\033[33m MTProxy 代理程序不存在请重新安装! \033[0m" && exit 1) - echo "./mtg run $client_secret $proxy_tag -b 0.0.0.0:$port --multiplex-per-connection 500 --prefer-ip=ipv6 -t $local_ip:$web_port" + echo "./mtg run $client_secret $proxy_tag -b 0.0.0.0:$port --multiplex-per-connection 500 --prefer-ip=ipv6 -t $local_ip:$web_port" -4 "$public_ip:$port" else curl -s https://core.telegram.org/getProxyConfig -o proxy-multi.conf curl -s https://core.telegram.org/getProxySecret -o proxy-secret