转发CDN节点支持自定义端口

This commit is contained in:
KANIKIG
2021-03-10 23:42:34 +08:00
parent 43022363ef
commit 2dc0a6a6fd

36
gost.sh
View File

@@ -266,26 +266,22 @@ function read_d_ip() {
echo -e "------------------------------------------------------------------"
echo -e "将本机从${flag_b}接收到的流量转发向的自选ip:"
read -p "请输入: " flag_c
if [ "$flag_a" == "cdnno" ]; then
echo -e "请问你要将本机从${flag_b}接收到的流量转发向${flag_c}的哪个端口?"
echo -e "[1] 80"
echo -e "[2] 443"
read -p "请选择端口: " cdnport
if [ "$cdnport" == "1" ]; then
flag_c="$flag_c:80"
elif [ "$cdnport" == "2" ]; then
flag_c="$flag_c:443"
else
echo "type error, please try again"
exit
fi
elif [ "$flag_a" == "cdnws" ]; then
echo -e "ws将默认转发至80端口"
flag_c="$flag_c:80"
else
echo -e "wss将默认转发至443端口"
flag_c="$flag_c:443"
fi
echo -e "请问你要将本机从${flag_b}接收到的流量转发向${flag_c}的哪个端口?"
echo -e "[1] 80"
echo -e "[2] 443"
echo -e "[3] 自定义端口如8080等"
read -p "请选择端口: " cdnport
if [ "$cdnport" == "1" ]; then
flag_c="$flag_c:80"
elif [ "$cdnport" == "2" ]; then
flag_c="$flag_c:443"
elif [ "$cdnport" == "3" ]; then
read -p "请输入自定义端口: " customport
flag_c="$flag_c:$customport"
else
echo "type error, please try again"
exit
fi
else
echo -e "------------------------------------------------------------------"
echo -e "请问你要将本机从${flag_b}接收到的流量转发向哪个IP或域名?"