From 2183fd2d876ae1f77207640d4c459920e48f0a7d Mon Sep 17 00:00:00 2001 From: mack-a <57424792+mack-a@users.noreply.github.com> Date: Mon, 28 Jun 2021 14:55:43 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=84=9A=E6=9C=AC):=20=E7=A7=BB=E9=99=A4V?= =?UTF-8?q?Mess=20tcp=20http=E4=BC=AA=E8=A3=85=E3=80=81=E5=88=86=E4=BA=AB?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=E5=A2=9E=E5=8A=A0alpn=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=E6=80=A7=E3=80=81README=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=8E=A8=E8=8D=90=E5=AE=A2=E6=88=B7=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 10 +++ install.sh | 192 ++++++++++++++++++++++++++++------------------------- 2 files changed, 113 insertions(+), 89 deletions(-) diff --git a/README.md b/README.md index c8ea2c6..182e9a3 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,16 @@ [支持通过虚拟币向我捐赠](https://github.com/mack-a/v2ray-agent/blob/master/documents/donation.md) +## 客户端推荐 +- Android +[AnXray](https://github.com/XTLS/AnXray/releases)[推荐使用最新版本] + +- iOS +Shadowrocket + +- win/Mac/Linux +[Qv2ray](https://github.com/Qv2ray/Qv2ray/actions)[推荐action版本] + ## 安装脚本 - 支持快捷方式启动,安装完毕后,shell输入【**vasma**】即可打开脚本,脚本执行路径[**/etc/v2ray-agent/install.sh**] diff --git a/install.sh b/install.sh index 2c4481c..7f4d0f5 100644 --- a/install.sh +++ b/install.sh @@ -1718,45 +1718,45 @@ EOF fi # VMess_TCP - if echo "${selectCustomInstallType}" | grep -q 2 || [[ "$1" == "all" ]]; then - fallbacksList=${fallbacksList}',{"path":"/'${customPath}'tcp","dest":31298,"xver":1}' - cat </etc/v2ray-agent/v2ray/conf/04_VMess_TCP_inbounds.json -{ -"inbounds":[ -{ - "port": 31298, - "listen": "127.0.0.1", - "protocol": "vmess", - "tag":"VMessTCP", - "settings": { - "clients": [ - { - "id": "${uuid}", - "alterId": 0, - "email": "${domain}_vmess_tcp" - } - ] - }, - "streamSettings": { - "network": "tcp", - "security": "none", - "tcpSettings": { - "acceptProxyProtocol": true, - "header": { - "type": "http", - "request": { - "path": [ - "/${customPath}tcp" - ] - } - } - } - } -} -] -} -EOF - fi +# if echo "${selectCustomInstallType}" | grep -q 2 || [[ "$1" == "all" ]]; then +# fallbacksList=${fallbacksList}',{"path":"/'${customPath}'tcp","dest":31298,"xver":1}' +# cat </etc/v2ray-agent/v2ray/conf/04_VMess_TCP_inbounds.json +#{ +#"inbounds":[ +#{ +# "port": 31298, +# "listen": "127.0.0.1", +# "protocol": "vmess", +# "tag":"VMessTCP", +# "settings": { +# "clients": [ +# { +# "id": "${uuid}", +# "alterId": 0, +# "email": "${domain}_vmess_tcp" +# } +# ] +# }, +# "streamSettings": { +# "network": "tcp", +# "security": "none", +# "tcpSettings": { +# "acceptProxyProtocol": true, +# "header": { +# "type": "http", +# "request": { +# "path": [ +# "/${customPath}tcp" +# ] +# } +# } +# } +# } +#} +#] +#} +#EOF +# fi # VMess_WS if echo "${selectCustomInstallType}" | grep -q 3 || [[ "$1" == "all" ]]; then @@ -1851,8 +1851,8 @@ EOF "security": "tls", "tlsSettings": { "alpn": [ - "h2", - "http/1.1" + "http/1.1", + "h2" ], "certificates": [ { @@ -2020,7 +2020,7 @@ EOF # trojan if [[ -n $(echo "${selectCustomInstallType}" | grep 4) || "$1" == "all" ]]; then # fallbacksList=${fallbacksList}',{"path":"/'${customPath}'tcp","dest":31298,"xver":1}' - fallbacksList='{"dest":31296,"xver":1},{"dest":30301,"xver":1},{"alpn":"h2","dest":31302,"xver":0}' + fallbacksList='{"dest":31296,"xver":1},{"alpn":"h2","dest":31302,"xver":0}' cat </etc/v2ray-agent/xray/conf/04_trojan_TCP_inbounds.json { "inbounds":[ @@ -2092,46 +2092,46 @@ EOF EOF fi - # VMess_TCP - if [[ -n $(echo ${selectCustomInstallType} | grep 2) || "$1" == "all" ]]; then - fallbacksList=${fallbacksList}',{"path":"/'${customPath}'tcp","dest":31298,"xver":1}' - cat </etc/v2ray-agent/xray/conf/04_VMess_TCP_inbounds.json -{ -"inbounds":[ -{ - "port": 31298, - "listen": "127.0.0.1", - "protocol": "vmess", - "tag":"VMessTCP", - "settings": { - "clients": [ - { - "id": "${uuid}", - "alterId": 0, - "email": "${domain}_vmess_tcp" - } - ] - }, - "streamSettings": { - "network": "tcp", - "security": "none", - "tcpSettings": { - "acceptProxyProtocol": true, - "header": { - "type": "http", - "request": { - "path": [ - "/${customPath}tcp" - ] - } - } - } - } -} -] -} -EOF - fi +# # VMess_TCP +# if [[ -n $(echo ${selectCustomInstallType} | grep 2) || "$1" == "all" ]]; then +# fallbacksList=${fallbacksList}',{"path":"/'${customPath}'tcp","dest":31298,"xver":1}' +# cat </etc/v2ray-agent/xray/conf/04_VMess_TCP_inbounds.json +#{ +#"inbounds":[ +#{ +# "port": 31298, +# "listen": "127.0.0.1", +# "protocol": "vmess", +# "tag":"VMessTCP", +# "settings": { +# "clients": [ +# { +# "id": "${uuid}", +# "alterId": 0, +# "email": "${domain}_vmess_tcp" +# } +# ] +# }, +# "streamSettings": { +# "network": "tcp", +# "security": "none", +# "tcpSettings": { +# "acceptProxyProtocol": true, +# "header": { +# "type": "http", +# "request": { +# "path": [ +# "/${customPath}tcp" +# ] +# } +# } +# } +# } +#} +#] +#} +#EOF +# fi # VMess_WS @@ -2228,8 +2228,8 @@ EOF "xtlsSettings": { "minVersion": "1.2", "alpn": [ - "h2", - "http/1.1" + "http/1.1", + "h2" ], "certificates": [ { @@ -2390,11 +2390,25 @@ EOF elif [[ "${type}" == "vmesstcp" ]]; then - qrCodeBase64Default=$(echo -n '{"alpn":"http1.1","port":"'${port}'","ps":'${ps}',"tls":"tls","id":'"${id}"',"aid":"0","v":"2","host":"'${host}'","type":"http","path":"/'${path}'","net":"tcp","add":"'${add}'","allowInsecure":0,"method":"post","peer":"'${host}'","obfs":"http","obfsParam":"'${host}'"}' | sed 's#/#\\\/#g' | base64) +# echoContent yellow " ---> 通用格式[新版,推荐]" +# +# echoContent green " vmess://tcp+tls:2e6257c5-1402-41a6-a96d-1e0bdad78159-0@vu3.s83h.xyz:443/?type=http&tlsServerName=vu3.s83h.xyz#vu3.s83h.xyz_vmess_tcp" +# echoContent green " vmess://tcp+tls:${id//\"/}-0@${add}:${port}/?type=http&path=/${path}&tlsServerName=${host}&alpn=http1.1#${ps//\"/}\n" +# +# echoContent yellow " ---> 格式化明文(vmess+http+tls)" +# echoContent green "协议类型:vmess,地址:${host},端口:${port},用户ID:${id},安全:tls,传输方式:http,账户名:${ps}\n" +# cat <>"/etc/v2ray-agent/subscribe_tmp/${subAccount}" +#vmess://http+tls:${id}-0@${add}:${port}/?path=/${path}&tlsServerName=${host}&alpn=http1.1#${ps} +#EOF +# echoContent yellow " ---> 二维码 vmess(http+tls)" +# echoContent green " https://api.qrserver.com/v1/create-qr-code/?size=400x400&data=vmess%3A%2F%2Fhttp%2Btls%3A${id}-0%40add%3A${port}%2F%3Fpath%3D%2F${path}%26tlsServerName%3D${host}%26alpn%3Dhttp1.1%23%24%7B${ps}%7D\n" + + echoContent red path:${path} + qrCodeBase64Default=$(echo -n '{"add":"'${add}'","aid":"0","host":"'${host}'","id":'"${id}"',"net":"tcp","path":"/'${path}'","port":"'${port}'","ps":'${ps}',"scy":"none","sni":"'${host}'","tls":"tls","v":"2","type":"http","allowInsecure":0,"peer":"'${host}'","obfs":"http","obfsParam":"'${host}'"}' | base64) qrCodeBase64Default=$(echo ${qrCodeBase64Default} | sed 's/ //g') echoContent yellow " ---> 通用json(VMess+TCP+TLS)" - echoContent green ' {"alpn":"http1.1","port":"'${port}'","ps":'${ps}',"tls":"tls","id":'"${id}"',"aid":"0","v":"2","host":"'${host}'","type":"http","path":"/'${path}'","net":"http","add":"'${add}'","allowInsecure":0,"method":"post","peer":"'${host}'","obfs":"http","obfsParam":"'${host}'"}\n' + echoContent green ' {"port":"'${port}'","ps":'${ps}',"tls":"tls","id":'"${id}"',"aid":"0","v":"2","host":"'${host}'","type":"http","path":"/'${path}'","net":"http","add":"'${add}'","allowInsecure":0,"method":"post","peer":"'${host}'","obfs":"http","obfsParam":"'${host}'"}\n' echoContent yellow " ---> 通用vmess(VMess+TCP+TLS)链接" echoContent green " vmess://${qrCodeBase64Default}\n" @@ -2439,7 +2453,7 @@ EOF vless://${VLESSID}@${add}:${port}?encryption=none&security=tls&type=grpc&host=${host}&path=${path}&serviceName=${path}&alpn=h2#${VLESSEmail} EOF echoContent yellow " ---> 二维码 VLESS(VLESS+gRPC+TLS)" - echoContent green " https://api.qrserver.com/v1/create-qr-code/?size=400x400&data=vless%3A%2F%2F${VLESSID}%40${add}%3A${port}%3Fencryption%3Dnone%26security%3Dtls%26type%3Dgrpc%26host%3D${host}%26path%3D${path}%23${VLESSEmail}" + echoContent green " https://api.qrserver.com/v1/create-qr-code/?size=400x400&data=vless%3A%2F%2F${VLESSID}%40${add}%3A${port}%3Fencryption%3Dnone%26security%3Dtls%26type%3Dgrpc%26host%3D${host}%26serviceName%3D${path}%26path%3D${path}%26alpn%3Dh2%23${VLESSEmail}" elif [[ "${type}" == "trojan" ]]; then # URLEncode @@ -2447,10 +2461,10 @@ EOF echoContent green " trojan://${id}@${host}:${port}?peer=${host}&sni=${host}&alpn=http1.1#${host}_trojan\n" cat <>"/etc/v2ray-agent/subscribe_tmp/${subAccount}" -trojan://${id}@${host}:${port}?peer=${host}&sni=${host}#${host}_trojan +trojan://${id}@${host}:${port}?peer=${host}&sni=${host}&alpn=http1.1#${host}_trojan EOF echoContent yellow " ---> 二维码 Trojan(TLS)" - echoContent green " https://api.qrserver.com/v1/create-qr-code/?size=400x400&data=trojan%3a%2f%2f${id}%40${host}%3a${port}%3fpeer%3d${host}%26sni%3d${host}%23${host}_trojan\n" + echoContent green " https://api.qrserver.com/v1/create-qr-code/?size=400x400&data=trojan%3a%2f%2f${id}%40${host}%3a${port}%3fpeer%3d${host}%26sni%3d${host}%26alpn%3Dhttp1.1%23${host}_trojan\n" elif [[ "${type}" == "trojangows" ]]; then # URLEncode