feat(脚本): 添加vless+ws+tls

pull/534/merge
mack-a 2020-09-11 10:56:10 +08:00
parent 421a5ae4d5
commit 7b40e9f10a
1 changed files with 58 additions and 28 deletions

View File

@ -13,6 +13,7 @@ totalProgress=1
iplc=$1 iplc=$1
uuidws= uuidws=
uuidtcp= uuidtcp=
uuidVlessWS=
trap 'onCtrlC' INT trap 'onCtrlC' INT
function onCtrlC () { function onCtrlC () {
@ -775,6 +776,7 @@ initV2RayConfig(){
uuidtcp=`/etc/v2ray-agent/v2ray/v2ctl uuid` uuidtcp=`/etc/v2ray-agent/v2ray/v2ctl uuid`
uuidws=`/etc/v2ray-agent/v2ray/v2ctl uuid` uuidws=`/etc/v2ray-agent/v2ray/v2ctl uuid`
uuidVmessTcp=`/etc/v2ray-agent/v2ray/v2ctl uuid` uuidVmessTcp=`/etc/v2ray-agent/v2ray/v2ctl uuid`
uuidVlessWS=`/etc/v2ray-agent/v2ray/v2ctl uuid`
echoContent skyBlue "\n进度 $2/${totalProgress} : 初始化V2Ray配置" echoContent skyBlue "\n进度 $2/${totalProgress} : 初始化V2Ray配置"
# 自定义IPLC端口 # 自定义IPLC端口
if [[ ! -z ${iplc} ]] if [[ ! -z ${iplc} ]]
@ -1047,7 +1049,7 @@ EOF
{ {
"log": { "log": {
"access":"/etc/v2ray-agent/v2ray/v2ray_access.log", "access":"/etc/v2ray-agent/v2ray/v2ray_access.log",
"error":"/etc/v2ray-agent/v2ray/v2ray_error.log", "error":"/etc/v2ray-agent/v2ray/v2ray_error.log",
"loglevel": "debug" "loglevel": "debug"
}, },
"inbounds": [ "inbounds": [
@ -1077,6 +1079,11 @@ EOF
"path": "/${customPath}tcp", "path": "/${customPath}tcp",
"dest": 31298, "dest": 31298,
"xver": 1 "xver": 1
},
{
"path": "/${customPath}ws",
"dest": 31297,
"xver": 1
} }
] ]
}, },
@ -1104,7 +1111,7 @@ EOF
{ {
"id": "${uuidws}", "id": "${uuidws}",
"alterId": 0, "alterId": 0,
"add":"${add}", "add": "${add}",
"level": 1, "level": 1,
"email": "${domain}_vmess_ws" "email": "${domain}_vmess_ws"
} }
@ -1120,34 +1127,57 @@ EOF
} }
}, },
{ {
"port": 31298, "port": 31298,
"listen": "127.0.0.1", "listen": "127.0.0.1",
"protocol": "vmess", "protocol": "vmess",
"settings": { "settings": {
"clients": [ "clients": [
{ {
"id": "${uuidVmessTcp}", "id": "${uuidVmessTcp}",
"level": 0, "level": 0,
"email": "${domain}_vmess_tcp" "email": "${domain}_vmess_tcp"
} }
] ]
}, },
"streamSettings": { "streamSettings": {
"network": "tcp", "network": "tcp",
"security": "none", "security": "none",
"tcpSettings": { "tcpSettings": {
"acceptProxyProtocol": true, "acceptProxyProtocol": true,
"header": { "header": {
"type": "http", "type": "http",
"request": { "request": {
"path": [ "path": [
"/${customPath}tcp" "/${customPath}tcp"
] ]
}
}
}
} }
}
} }
}
},
{
"port": 31297,
"listen": "127.0.0.1",
"protocol": "vless",
"settings": {
"clients": [
{
"id": "${uuidVlessWS}",
"level": 0,
"email": "${domain}_vless_ws"
}
],
"decryption": "none"
},
"streamSettings": {
"network": "ws",
"security": "none",
"wsSettings": {
"acceptProxyProtocol": true,
"path": "/${customPath}ws"
}
}
}
], ],
"outbounds": [ "outbounds": [
{ {