From 640f3fcba3a94da03377f12503957df45473f7f8 Mon Sep 17 00:00:00 2001 From: chauncey <23046078+ellermister@users.noreply.github.com> Date: Fri, 1 Apr 2022 12:06:44 +0800 Subject: [PATCH] Update mtproxy.sh --- mtproxy.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mtproxy.sh b/mtproxy.sh index 470b11b..d219dd4 100644 --- a/mtproxy.sh +++ b/mtproxy.sh @@ -177,8 +177,8 @@ config_mtp(){ done # config info - public_ip=$(curl -s https://api.ip.sb/ip --ipv4) - [ -z "$public_ip" ] && public_ip=$(curl -s ipinfo.io/ip --ipv4) + public_ip=$(curl -s https://api.ip.sb/ip -A Mozilla --ipv4) + [ -z "$public_ip" ] && public_ip=$(curl -s ipinfo.io/ip -A Mozilla --ipv4) secret=$(head -c 16 /dev/urandom | xxd -ps) # proxy tag @@ -230,8 +230,8 @@ info_mtp(){ status_mtp if [ $? == 1 ];then source ./mtp_config - public_ip=$(curl -s https://api.ip.sb/ip --ipv4) - [ -z "$public_ip" ] && public_ip=$(curl -s ipinfo.io/ip --ipv4) + public_ip=$(curl -s https://api.ip.sb/ip -A Mozilla --ipv4) + [ -z "$public_ip" ] && public_ip=$(curl -s ipinfo.io/ip -A Mozilla --ipv4) domain_hex=$(xxd -pu <<< $domain | sed 's/0a//g') client_secret="ee${secret}${domain_hex}" echo -e "TMProxy+TLS代理: \033[32m运行中\033[0m" @@ -255,8 +255,8 @@ run_mtp(){ curl -s https://core.telegram.org/getProxyConfig -o proxy-multi.conf source ./mtp_config nat_ip=$(echo $(ip a | grep inet | grep -v 127.0.0.1 | grep -v inet6 | awk '{print $2}' | cut -d "/" -f1 |awk 'NR==1 {print $1}')) - public_ip=`curl -s https://api.ip.sb/ip --ipv4` - [ -z "$public_ip" ] && public_ip=$(curl -s ipinfo.io/ip --ipv4) + public_ip=`curl -s https://api.ip.sb/ip -A Mozilla --ipv4` + [ -z "$public_ip" ] && public_ip=$(curl -s ipinfo.io/ip -A Mozilla --ipv4) nat_info="" if [[ $nat_ip != $public_ip ]];then nat_info="--nat-info ${nat_ip}:${public_ip}" @@ -275,8 +275,8 @@ debug_mtp(){ cd $WORKDIR source ./mtp_config nat_ip=$(echo $(ip a | grep inet | grep -v 127.0.0.1 | grep -v inet6 | awk '{print $2}' | cut -d "/" -f1 |awk 'NR==1 {print $1}')) - public_ip=`curl -s https://api.ip.sb/ip --ipv4` - [ -z "$public_ip" ] && public_ip=$(curl -s ipinfo.io/ip --ipv4) + public_ip=`curl -s https://api.ip.sb/ip -A Mozilla --ipv4` + [ -z "$public_ip" ] && public_ip=$(curl -s ipinfo.io/ip -A Mozilla --ipv4) nat_info="" if [[ $nat_ip != $public_ip ]];then nat_info="--nat-info ${nat_ip}:${public_ip}"