diff --git a/_worker.js b/_worker.js index d07df1e..82d0908 100644 --- a/_worker.js +++ b/_worker.js @@ -120,13 +120,17 @@ export default { return new Response(`${fakeConfig}`, { status: 200 }); case `/${userID}`: { await sendMessage(`#获取订阅 ${FileName}`, request.headers.get('CF-Connecting-IP'), `UA: ${UA}\n域名: ${url.hostname}\n入口: ${url.pathname + url.search}`); - if ((!sub || sub == '') && (addresses.length + addressesapi.length + addressesnotls.length + addressesnotlsapi.length + addressescsv.length) == 0){ - if (request.headers.get('Host').includes(".workers.dev")) { - sub = 'workervless2sub-f1q.pages.dev'; - subconfig = 'https://raw.githubusercontent.com/cmliu/ACL4SSR/main/Clash/config/ACL4SSR_Online.ini'; + if (!sub || sub == ''){ + if((addresses.length + addressesapi.length + addressesnotls.length + addressesnotlsapi.length + addressescsv.length) == 0){ + if (request.headers.get('Host').includes(".workers.dev")) { + sub = 'workervless2sub-f1q.pages.dev'; + subconfig = 'https://raw.githubusercontent.com/cmliu/ACL4SSR/main/Clash/config/ACL4SSR_Online.ini'; + } else { + sub = 'vless-4ca.pages.dev'; + subconfig = "https://raw.githubusercontent.com/cmliu/ACL4SSR/main/Clash/config/ACL4SSR_Online_Full_MultiMode.ini"; + } } else { - sub = 'vless-4ca.pages.dev'; - subconfig = "https://raw.githubusercontent.com/cmliu/ACL4SSR/main/Clash/config/ACL4SSR_Online_Full_MultiMode.ini"; + noTLS = 'true'; } } const vlessConfig = await getVLESSConfig(userID, request.headers.get('Host'), sub, UA, RproxyIP, url); @@ -1297,12 +1301,14 @@ https://github.com/cmliu/edgetunnel // 如果是使用默认域名,则改成一个workers的域名,订阅器会加上代理 if (hostName.includes(".workers.dev")){ + noTLS = 'true' fakeHostName = `${fakeHostName}.workers.dev`; newAddressesnotlsapi = await getAddressesapi(addressesnotlsapi); newAddressesnotlscsv = await getAddressescsv('FALSE'); } else if (hostName.includes(".pages.dev")){ fakeHostName = `${fakeHostName}.pages.dev`; } else if (hostName.includes("worker") || hostName.includes("notls") || noTLS == 'true'){ + noTLS = 'true' fakeHostName = `notls.${fakeHostName}.net`; newAddressesnotlsapi = await getAddressesapi(addressesnotlsapi); newAddressesnotlscsv = await getAddressescsv('FALSE'); @@ -1619,14 +1625,9 @@ function subAddresses(host,UUID,noTLS,newAddressesapi,newAddressescsv,newAddress let 伪装域名 = host ; let 最终路径 = '/?ed=2560' ; let 节点备注 = ''; + const 协议类型 = atob(啥啥啥_写的这是啥啊); - if(proxyhosts.length > 0 && (伪装域名.includes('.workers.dev') || 伪装域名.includes('pages.dev'))) { - 最终路径 = `/${伪装域名}${最终路径}`; - 伪装域名 = proxyhosts[Math.floor(Math.random() * proxyhosts.length)]; - 节点备注 = ` 已启用临时域名中转服务,请尽快绑定自定义域!`; - } - - const vlessLink = `vless://${UUID}@${address}:${port}?encryption=none&security=&type=ws&host=${伪装域名}&path=${encodeURIComponent(最终路径)}#${encodeURIComponent(addressid + 节点备注)}`; + const vlessLink = `${协议类型}://${UUID}@${address}:${port}?encryption=none&security=&type=ws&host=${伪装域名}&path=${encodeURIComponent(最终路径)}#${encodeURIComponent(addressid + 节点备注)}`; return vlessLink;