From e8339d0652b399419a216048e7300b164095bd03 Mon Sep 17 00:00:00 2001 From: 233boy <31657650+233boy@users.noreply.github.com> Date: Fri, 14 May 2021 19:01:45 +0800 Subject: [PATCH] support vless url --- src/qr.sh | 6 +++++- v2ray.sh | 24 ++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/qr.sh b/src/qr.sh index 5efcf86..a96d114 100644 --- a/src/qr.sh +++ b/src/qr.sh @@ -1,5 +1,9 @@ _qr_create() { - local vmess="vmess://$(cat /etc/v2ray/vmess_qr.json | base64 -w 0)" + if [[ $v2ray_transport == 33 ]]; then + local vmess="$(cat /etc/v2ray/vmess_qr.json)" + else + local vmess="vmess://$(cat /etc/v2ray/vmess_qr.json | base64 -w 0)" + fi local link="https://233boy.github.io/tools/qr.html#${vmess}" echo echo "---------- V2Ray 二维码链接 适用于 V2RayNG v0.4.1+ / Kitsunebi -------------" diff --git a/v2ray.sh b/v2ray.sh index 137b5b4..980de8c 100644 --- a/v2ray.sh +++ b/v2ray.sh @@ -10,7 +10,7 @@ none='\e[0m' # Root [[ $(id -u) != 0 ]] && echo -e " 哎呀……请使用 ${red}root ${none}用户运行 ${yellow}~(^_^) ${none}" && exit 1 -_version="v3.43" +_version="v3.44" cmd="apt-get" @@ -140,6 +140,10 @@ create_vmess_URL_config() { "tls": "tls" } EOF + elif [[ $v2ray_transport == 33 ]]; then + cat >/etc/v2ray/vmess_qr.json <<-EOF + vless://${v2ray_id}@${domain}:443?encryption=none&security=tls&type=ws&host=${domain}&path=${_path}#233v2_${domain} + EOF else [[ -z $ip ]] && get_ip cat >/etc/v2ray/vmess_qr.json <<-EOF @@ -2264,7 +2268,11 @@ get_v2ray_config_qr_link() { } get_v2ray_vmess_URL_link() { create_vmess_URL_config - local vmess="vmess://$(cat /etc/v2ray/vmess_qr.json | base64 -w 0)" + if [[ $v2ray_transport == 33 ]]; then + local vmess="$(cat /etc/v2ray/vmess_qr.json)" + else + local vmess="vmess://$(cat /etc/v2ray/vmess_qr.json | base64 -w 0)" + fi echo echo "---------- V2Ray vmess URL / V2RayNG v0.4.1+ / V2RayN v2.1+ / 仅适合部分客户端 -------------" echo @@ -2704,12 +2712,6 @@ L | infolink) get_v2ray_config_info_link ;; q | qr) - if [[ $v2ray_transport == 33 ]]; then - echo - echo ' V2RAY VLESS 协议相关暂不支持生成 ....' - echo - exit - fi get_v2ray_config_qr_link ;; s | ss) @@ -2777,12 +2779,6 @@ log) view_v2ray_log ;; url | URL) - if [[ $v2ray_transport == 33 ]]; then - echo - echo ' V2RAY VLESS 协议相关暂不支持生成 URL ....' - echo - exit - fi get_v2ray_vmess_URL_link ;; u | update)