feat(脚本): 添加VLESS+WS+TLS

pull/534/merge
mack-a 2020-09-11 11:24:56 +08:00
parent 7b40e9f10a
commit 30d648f005
1 changed files with 28 additions and 13 deletions

View File

@ -1269,9 +1269,9 @@ defaultBase64Code(){
then then
qrCodeBase64Default=`echo -n '{"port":"443","ps":"'${ps}'","tls":"tls","id":'"${id}"',"aid":"0","v":"2","host":"'${host}'","type":"none","path":'${path}',"net":"tcp","add":"'${add}'","allowInsecure":0,"method":"none","peer":"'${host}'"}'|sed 's#/#\\\/#g'|base64` qrCodeBase64Default=`echo -n '{"port":"443","ps":"'${ps}'","tls":"tls","id":'"${id}"',"aid":"0","v":"2","host":"'${host}'","type":"none","path":'${path}',"net":"tcp","add":"'${add}'","allowInsecure":0,"method":"none","peer":"'${host}'"}'|sed 's#/#\\\/#g'|base64`
qrCodeBase64Default=`echo ${qrCodeBase64Default}|sed 's/ //g'` qrCodeBase64Default=`echo ${qrCodeBase64Default}|sed 's/ //g'`
echo "通用vmess(ws+tls)链接: " > /etc/v2ray-agent/v2ray/usersv2ray.conf echo "通用vmess(VLESS+TCP+TLS)链接: " > /etc/v2ray-agent/v2ray/usersv2ray.conf
echo " vmess://${qrCodeBase64Default}" >> /etc/v2ray-agent/v2ray/usersv2ray.conf echo " vmess://${qrCodeBase64Default}" >> /etc/v2ray-agent/v2ray/usersv2ray.conf
echoContent yellow " ---> 通用json(VLESS+tcp+tls)" echoContent yellow " ---> 通用json(VLESS+TCP+TLS)"
echoContent green ' {"port":"443","ps":"'${ps}'","tls":"tls","id":'"${id}"',"host":"'${host}'","type":"none","net":"tcp","add":"'${host}'","allowInsecure":0,"method":"none","peer":""}\n' echoContent green ' {"port":"443","ps":"'${ps}'","tls":"tls","id":'"${id}"',"host":"'${host}'","type":"none","net":"tcp","add":"'${host}'","allowInsecure":0,"method":"none","peer":""}\n'
echoContent green ' V2Ray v4.27.4+ 目前无通用订阅需要手动配置VLESS和tcp大部分一样其余内容不变\n' echoContent green ' V2Ray v4.27.4+ 目前无通用订阅需要手动配置VLESS和tcp大部分一样其余内容不变\n'
@ -1279,23 +1279,29 @@ defaultBase64Code(){
then then
qrCodeBase64Default=`echo -n '{"port":"443","ps":"'${ps}'","tls":"tls","id":'"${id}"',"aid":"0","v":"2","host":"'${host}'","type":"none","path":'${path}',"net":"ws","add":"'${add}'","allowInsecure":0,"method":"none","peer":"'${host}'"}'|sed 's#/#\\\/#g'|base64` qrCodeBase64Default=`echo -n '{"port":"443","ps":"'${ps}'","tls":"tls","id":'"${id}"',"aid":"0","v":"2","host":"'${host}'","type":"none","path":'${path}',"net":"ws","add":"'${add}'","allowInsecure":0,"method":"none","peer":"'${host}'"}'|sed 's#/#\\\/#g'|base64`
qrCodeBase64Default=`echo ${qrCodeBase64Default}|sed 's/ //g'` qrCodeBase64Default=`echo ${qrCodeBase64Default}|sed 's/ //g'`
echoContent yellow " ---> 通用json(ws+tls)" echoContent yellow " ---> 通用json(VMess+WS+TLS)"
echoContent green ' {"port":"443","ps":"'${ps}'","tls":"tls","id":'"${id}"',"aid":"0","v":"2","host":"'${host}'","type":"none","path":'${path}',"net":"ws","add":"'${add}'","allowInsecure":0,"method":"none","peer":"'${host}'"}\n' echoContent green ' {"port":"443","ps":"'${ps}'","tls":"tls","id":'"${id}"',"aid":"0","v":"2","host":"'${host}'","type":"none","path":'${path}',"net":"ws","add":"'${add}'","allowInsecure":0,"method":"none","peer":"'${host}'"}\n'
echoContent yellow " ---> 通用vmess(ws+tls)链接" echoContent yellow " ---> 通用vmess(VMess+WS+TLS)链接"
echoContent green " vmess://${qrCodeBase64Default}\n" echoContent green " vmess://${qrCodeBase64Default}\n"
echoContent yellow " ---> 二维码 vmess(ws+tls)" echoContent yellow " ---> 二维码 vmess(VMess+WS+TLS)"
echoContent green "https://api.qrserver.com/v1/create-qr-code/?size=400x400&data=vmess://${qrCodeBase64Default}\n" echoContent green "https://api.qrserver.com/v1/create-qr-code/?size=400x400&data=vmess://${qrCodeBase64Default}\n"
elif [[ "${type}" = "vmesstcp" ]] elif [[ "${type}" = "vmesstcp" ]]
then then
qrCodeBase64Default=`echo -n '{"port":"443","ps":"'${ps}'","tls":"tls","id":'"${id}"',"aid":"0","v":"2","host":"'${host}'","type":"http","path":'${path}',"net":"tcp","add":"'${add}'","allowInsecure":0,"method":"none","peer":"'${host}'","obfs":"http","obfsParam":"'${host}'"}'|sed 's#/#\\\/#g'|base64` qrCodeBase64Default=`echo -n '{"port":"443","ps":"'${ps}'","tls":"tls","id":'"${id}"',"aid":"0","v":"2","host":"'${host}'","type":"http","path":'${path}',"net":"tcp","add":"'${add}'","allowInsecure":0,"method":"none","peer":"'${host}'","obfs":"http","obfsParam":"'${host}'"}'|sed 's#/#\\\/#g'|base64`
qrCodeBase64Default=`echo ${qrCodeBase64Default}|sed 's/ //g'` qrCodeBase64Default=`echo ${qrCodeBase64Default}|sed 's/ //g'`
echoContent yellow " ---> 通用json(VMess+tcp+tls)" echoContent yellow " ---> 通用json(VMess+TCP+TLS)"
echoContent green ' {"port":"443","ps":"'${ps}'","tls":"tls","id":'"${id}"',"aid":"0","v":"2","host":"'${host}'","type":"http","path":'${path}',"net":"tcp","add":"'${add}'","allowInsecure":0,"method":"none","peer":"'${host}'","obfs":"http","obfsParam":"'${host}'"}\n' echoContent green ' {"port":"443","ps":"'${ps}'","tls":"tls","id":'"${id}"',"aid":"0","v":"2","host":"'${host}'","type":"http","path":'${path}',"net":"tcp","add":"'${add}'","allowInsecure":0,"method":"none","peer":"'${host}'","obfs":"http","obfsParam":"'${host}'"}\n'
echoContent yellow " ---> 通用vmess(VMess+tcp+tls)链接" echoContent yellow " ---> 通用vmess(VMess+TCP+TLS)链接"
echoContent green " vmess://${qrCodeBase64Default}\n" echoContent green " vmess://${qrCodeBase64Default}\n"
echoContent yellow " ---> 二维码 vmess(VMess+tcp+tls)" echoContent yellow " ---> 二维码 vmess(VMess+TCP+TLS)"
echoContent green "https://api.qrserver.com/v1/create-qr-code/?size=400x400&data=vmess://${qrCodeBase64Default}\n" echoContent green "https://api.qrserver.com/v1/create-qr-code/?size=400x400&data=vmess://${qrCodeBase64Default}\n"
elif [[ "${type}" = "vlessws" ]]
then
qrCodeBase64Default=`echo -n '{"port":"443","ps":"'${ps}'","tls":"tls","id":'"${id}"',"aid":"0","v":"2","host":"'${host}'","type":"none","path":'${path}',"net":"ws","add":"'${add}'","allowInsecure":0,"method":"none","peer":"'${host}'"}'|sed 's#/#\\\/#g'|base64`
qrCodeBase64Default=`echo ${qrCodeBase64Default}|sed 's/ //g'`
echoContent yellow " ---> 通用json(VLESS+WS+TLS)"
echoContent green ' {"port":"443","ps":"'${ps}'","tls":"tls","id":'"${id}"',"aid":"0","v":"2","host":"'${host}'","type":"none","path":'${path}',"net":"ws","add":"'${add}'","allowInsecure":0,"method":"none","peer":"'${host}'"}\n'
fi fi
} }
# quanMult base64Code # quanMult base64Code
@ -1402,11 +1408,20 @@ showAccounts(){
local vmessTCPEmail="`echo ${vmessTCP}|jq .settings.clients[0].email|awk -F '["]' '{print $2}'`" local vmessTCPEmail="`echo ${vmessTCP}|jq .settings.clients[0].email|awk -F '["]' '{print $2}'`"
local vmessTCPath=`echo ${vmessTCP}|jq .streamSettings.tcpSettings.header.request.path[0]` local vmessTCPath=`echo ${vmessTCP}|jq .streamSettings.tcpSettings.header.request.path[0]`
echoContent red "\n===============================VMess+WS+TLS+CDN===============================" # VLESS ws
local vlessWS=`cat /etc/v2ray-agent/v2ray/config.json|jq .inbounds[3]`
local vlessWSID=`echo ${vlessWS}|jq .settings.clients[0].id`
local vlessWSAdd=`echo ${vlessWS}|jq .settings.clients[0].add|awk -F '["]' '{print $2}'`
local vlessWSEmail="`echo ${vlessWS}|jq .settings.clients[0].email|awk -F '["]' '{print $2}'`"
local vlessWSPath=`echo ${vlessWS}|jq .streamSettings.wsSettings.path`
echoContent skyBlue "\n===============================VMess+WS+TLS+CDN==============================="
defaultBase64Code vmessws ${wsEmail} "${wsID}" "${host}" "${wsPath}" ${wsAdd} defaultBase64Code vmessws ${wsEmail} "${wsID}" "${host}" "${wsPath}" ${wsAdd}
echoContent red "\n=============================== VLESS+TCP+TLS ===============================" echoContent skyBlue "\n=============================== VLESS+TCP+TLS ==============================="
defaultBase64Code vlesstcp ${tcpEmail} "${tcpID}" "${host}" ${add} defaultBase64Code vlesstcp ${tcpEmail} "${tcpID}" "${host}" ${add}
echoContent red "\n=============================== VMess+TCP+TLS ===============================" echoContent skyBlue "\n===============================VLESS+WS+TLS+CDN==============================="
defaultBase64Code vlessws ${vlessWSEmail} "${vlessWSID}" "${host}" "${vlessWSPath}" ${vlessWSAdd}
echoContent skyBlue "\n=============================== VMess+TCP+TLS ==============================="
defaultBase64Code vmesstcp ${vmessTCPEmail} "${vmessTCPID}" "${host}" "${vmessTCPath}" "${host}" defaultBase64Code vmesstcp ${vmessTCPEmail} "${vmessTCPID}" "${host}" "${vmessTCPath}" "${host}"
# local type=$1 # local type=$1
@ -1490,9 +1505,9 @@ menu(){
cd cd
echoContent red "\n==============================================================" echoContent red "\n=============================================================="
echoContent green "作者mack-a" echoContent green "作者mack-a"
echoContent green "当前版本v2.0.2" echoContent green "当前版本v2.0.3"
echoContent red "==============================================================" echoContent red "=============================================================="
echoContent yellow "1.(VLESS+TCP+TLS/VMess+TCP+TLS/VMess+WS+TLS)+伪装博客 三合一共存脚本[Cloudflare云朵需为灰色]" echoContent yellow "1.(VLESS+TCP+TLS/VMess+TCP+TLS/VMess+WS+TLS/VLESS+WS+TLS)+伪装博客 四合一共存脚本[Cloudflare云朵需为灰色]"
# echoContent yellow "2.V2Ray+TCP+TLS" # echoContent yellow "2.V2Ray+TCP+TLS"
echoContent red "==============================================================" echoContent red "=============================================================="
echoContent yellow "4.更新V2Ray" echoContent yellow "4.更新V2Ray"