Skip to content

Commit f156301

Browse files
authored
Fix mtg startup failure in due to the error in obtaining the public ip
1 parent 81c7307 commit f156301

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

mtproxy.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,10 +424,11 @@ function get_run_command(){
424424
domain_hex=$(str_to_hex $domain)
425425
client_secret="ee${secret}${domain_hex}"
426426
local local_ip=$(get_local_ip)
427+
public_ip=$(get_ip_public)
427428

428429
# ./mtg simple-run -n 1.1.1.1 -t 30s -a 512kib 0.0.0.0:$port $client_secret >/dev/null 2>&1 &
429430
[[ -f "./mtg" ]] || (echo -e "提醒:\033[33m MTProxy 代理程序不存在请重新安装! \033[0m" && exit 1)
430-
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"
431+
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"
431432
else
432433
curl -s https://core.telegram.org/getProxyConfig -o proxy-multi.conf
433434
curl -s https://core.telegram.org/getProxySecret -o proxy-secret

0 commit comments

Comments
 (0)