From 58686d5d125194d34a1137913b3a64ddcf55872f Mon Sep 17 00:00:00 2001 From: zizifn <1803942+zizifn@users.noreply.github.com> Date: Wed, 27 Nov 2024 17:25:48 +0800 Subject: [PATCH] change the protocal string format --- src/worker-vless.js | 7 ++++++- src/worker-with-socks5-experimental.js | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/worker-vless.js b/src/worker-vless.js index 601350a20..19b106b1f 100644 --- a/src/worker-vless.js +++ b/src/worker-vless.js @@ -600,7 +600,12 @@ async function handleUDPOutBound(webSocket, vlessResponseHeader, log) { * @returns {string} */ function getVLESSConfig(userID, hostName) { - const vlessMain = `vless://${userID}\u0040${hostName}:443?encryption=none&security=tls&sni=${hostName}&fp=randomized&type=ws&host=${hostName}&path=%2F%3Fed%3D2048#${hostName}` + const protocol = "vless"; + const vlessMain = + `${protocol}` + + `://${userID}@${hostName}:443`+ + `?encryption=none&security=tls&sni=${hostName}&fp=randomized&type=ws&host=${hostName}&path=%2F%3Fed%3D2048#${hostName}`; + return ` ################################################################ v2ray diff --git a/src/worker-with-socks5-experimental.js b/src/worker-with-socks5-experimental.js index 894189028..f7ee448c1 100644 --- a/src/worker-with-socks5-experimental.js +++ b/src/worker-with-socks5-experimental.js @@ -769,7 +769,12 @@ function socks5AddressParser(address) { * @returns {string} */ function getVLESSConfig(userID, hostName) { - const vlessMain = `vless://${userID}\u0040${hostName}:443?encryption=none&security=tls&sni=${hostName}&fp=randomized&type=ws&host=${hostName}&path=%2F%3Fed%3D2048#${hostName}` + const protocol = "vless"; + const vlessMain = + `${protocol}` + + `://${userID}@${hostName}:443`+ + `?encryption=none&security=tls&sni=${hostName}&fp=randomized&type=ws&host=${hostName}&path=%2F%3Fed%3D2048#${hostName}`; + return ` ################################################################ v2ray