fixed status error of v2ray, remain domain while using ws mode of v2ray

This commit is contained in:
leafnsand
2019-02-21 12:03:02 +08:00
parent 6f3c34ae9e
commit 7f3b70dbad
2 changed files with 13 additions and 5 deletions

View File

@@ -28,10 +28,12 @@ local ws="null"
local h2="null"
local tls="null"
IFIP=`echo $ss_server | grep -E "([0-9]{1,3}[\.]){3}[0-9]{1,3}|:"`
if [ -z "$IFIP" ]; then
ss_server_tmp=`nslookup $ss_server | sed 1,2d | grep -Eo "([0-9]{1,3}[\.]){3}[0-9]{1,3}" | head -1`
[ -z "$ss_server_tmp" ] && logsh "$service" "v2ray服务器地址解析失败跳过解析" || ss_server="$ss_server_tmp"
if [ "$ss_network" != "ws" ]; then
IFIP=`echo $ss_server | grep -E "([0-9]{1,3}[\.]){3}[0-9]{1,3}|:"`
if [ -z "$IFIP" ]; then
ss_server_tmp=`nslookup $ss_server | sed 1,2d | grep -Eo "([0-9]{1,3}[\.]){3}[0-9]{1,3}" | head -1`
[ -z "$ss_server_tmp" ] && logsh "$service" "v2ray服务器地址解析失败跳过解析" || ss_server="$ss_server_tmp"
fi
fi
get_ws_header() {