From 2f0125011f0892a3883507f35390a1103b166630 Mon Sep 17 00:00:00 2001 From: cometzok <168522625+cometzok@users.noreply.github.com> Date: Sat, 20 Jul 2024 09:27:38 +0800 Subject: [PATCH 1/2] Update _worker.js --- _worker.js | 494 ++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 336 insertions(+), 158 deletions(-) diff --git a/_worker.js b/_worker.js index a2b5745c0d..dbf4a373c0 100644 --- a/_worker.js +++ b/_worker.js @@ -20,7 +20,7 @@ let proxyIP = proxyIPs[Math.floor(Math.random() * proxyIPs.length)]; let dohURL = 'https://cloudflare-dns.com/dns-query'; -let panelVersion = '2.4.1'; +let panelVersion = '2.4.5'; if (!isValidUUID(userID)) { throw new Error('uuid is not valid'); @@ -74,9 +74,9 @@ export default { return new Response(`${JSON.stringify(fragConfigs, null, 4)}`, { status: 200 }); - case `/wow/${userID}`: + case `/warpsub/${userID}`: - const wowConfig = await getWoWConfig(env, client); + const wowConfig = await getWarpConfigs(env, client); return new Response(`${JSON.stringify(wowConfig, null, 4)}`, { status: 200 }); case '/panel': @@ -98,7 +98,9 @@ export default { } if (!isAuth) return Response.redirect(`${url.origin}/login`, 302); - if (! await env.bpb.get('proxySettings')) await updateDataset(env); + const proxySettings = await env.bpb.get("proxySettings", {type: 'json'}); + const isUpdated = panelVersion === proxySettings?.panelVersion; + if (!proxySettings || !isUpdated) await updateDataset(env); const fragConfs = await getFragmentConfigs(env, host, 'nekoray'); const homePage = await renderHomePage(env, host, fragConfs); @@ -197,7 +199,7 @@ export default { }); default: - // return new Response('Not found', { status: 404 }); + return new Response('Not found', { status: 404 }); url.hostname = 'www.speedtest.net'; url.protocol = 'https:'; request = new Request(url, request); @@ -807,7 +809,7 @@ const getNormalConfigs = async (env, hostName, client) => { }&fp=randomized&alpn=${ client === 'singbox' ? 'http/1.1' : 'h2,http/1.1' }` - : ''}&path=${`/${getRandomPath(16)}${proxyIP ? `/${btoa(proxyIP)}` : ''}`}${ + : ''}&path=${`/${getRandomPath(16)}${proxyIP ? `/${encodeURIComponent(btoa(proxyIP))}` : ''}`}${ client === 'singbox' ? '&eh=Sec-WebSocket-Protocol&ed=2560' : encodeURIComponent('?ed=2560') @@ -1022,7 +1024,7 @@ const getFragmentConfigs = async (env, hostName, client) => { proxyIP, outProxy, outProxyParams, - ports = ['443'] + ports } = proxySettings; const resolved = await resolveDNS(hostName); @@ -1148,24 +1150,26 @@ const getFragmentConfigs = async (env, hostName, client) => { } }); }); - - outbounds[0].settings.vnext[0].port = 443; - outbounds[0].tag = 'out'; - outbounds[1].tag = 'proxy'; + let bestFragmentOutbounds = structuredClone([{...outbounds[0]}, {...outbounds[1]}]); + bestFragmentOutbounds[0].settings.vnext[0].port = 443; + if (proxyOutbound) { - outbounds[0].streamSettings.sockopt.dialerProxy = 'proxy'; - delete outbounds[1].streamSettings.sockopt.dialerProxy; - bestFragment.outbounds = [outbounds[0], outbounds[1], ...bestFragment.outbounds]; + bestFragmentOutbounds[0].streamSettings.sockopt.dialerProxy = 'proxy'; + delete bestFragmentOutbounds[1].streamSettings.sockopt.dialerProxy; + bestFragmentOutbounds[0].tag = 'out'; + bestFragmentOutbounds[1].tag = 'proxy'; + bestFragment.outbounds = [bestFragmentOutbounds[0], bestFragmentOutbounds[1], ...bestFragment.outbounds]; bestFragment.routing.rules = buildRoutingRules(localDNS, blockAds, bypassIran, blockPorn, bypassLAN, true, true); } else { - delete outbounds[1].streamSettings.sockopt.dialerProxy; - bestFragment.outbounds = [outbounds[1], ...bestFragment.outbounds]; + delete bestFragmentOutbounds[0].streamSettings.sockopt.dialerProxy; + bestFragmentOutbounds[0].tag = 'proxy'; + bestFragment.outbounds = [bestFragmentOutbounds[0], ...bestFragment.outbounds]; bestFragment.routing.rules = buildRoutingRules(localDNS, blockAds, bypassIran, blockPorn, bypassLAN, false, true); } bestFragment.observatory.subjectSelector = ["frag"]; - bestFragment.observatory.probeInterval = '1m'; + bestFragment.observatory.probeInterval = '30s'; bestFragment.routing.balancers[0].selector = ["frag"]; if (client === 'nekoray') { @@ -1174,10 +1178,7 @@ const getFragmentConfigs = async (env, hostName, client) => { bestFragment.inbounds[2].port = 6450; } - const workerLessConfig = await buildWorkerLessConfig(env, client); - - - + const workerLessConfig = await buildWorkerLessConfig(env, client); Configs.push( { address: 'Best-Ping', config: bestPing}, { address: 'Best-Fragment', config: bestFragment}, @@ -1189,6 +1190,8 @@ const getFragmentConfigs = async (env, hostName, client) => { const getSingboxConfig = async (env, hostName) => { let proxySettings = {}; + let outboundDomains = []; + const domainRegex = /^(?!:\/\/)([a-zA-Z0-9-]{1,63}\.)*[a-zA-Z0-9][a-zA-Z0-9-]{0,62}\.[a-zA-Z]{2,11}$/; try { proxySettings = await env.bpb.get("proxySettings", {type: 'json'}); @@ -1201,7 +1204,6 @@ const getSingboxConfig = async (env, hostName) => { let config = structuredClone(singboxConfigTemp); config.dns.servers[0].address = remoteDNS; config.dns.servers[1].address = localDNS; - const resolved = await resolveDNS(hostName); const Addresses = [ hostName, @@ -1228,104 +1230,200 @@ const getSingboxConfig = async (env, hostName) => { config.outbounds.push(outbound); config.outbounds[0].outbounds.push(remark); config.outbounds[1].outbounds.push(remark); + if (domainRegex.test(outbound.server)) outboundDomains.push(outbound.server); }); }); + config.dns.rules[0].domain = [...new Set(outboundDomains)]; + return config; } -const getWoWConfig = async (env, client) => { +const getWarpConfigs = async (env, client) => { let proxySettings = {}; - let xrayOutbounds = [], singboxOutbounds = []; - + let xrayWarpConfigs = []; + let xrayWarpConfig = structuredClone(xrayConfigTemp); + let xrayWarpBestPing = structuredClone(xrayConfigTemp); + let xrayWoWConfigTemp = structuredClone(xrayConfigTemp); + let singboxWarpConfig = structuredClone(singboxConfigTemp); + let outboundDomains = []; + const domainRegex = /^(?!:\/\/)([a-zA-Z0-9-]{1,63}\.)*[a-zA-Z0-9][a-zA-Z0-9-]{0,62}\.[a-zA-Z]{2,11}$/; + try { proxySettings = await env.bpb.get("proxySettings", {type: 'json'}); } catch (error) { console.log(error); throw new Error(`An error occurred while getting fragment configs - ${error}`); } + + const {remoteDNS, localDNS, blockAds, bypassIran, blockPorn, bypassLAN, wowEndpoint, warpEndpoints} = proxySettings; + const {xray: xrayWarpOutbounds, singbox: singboxWarpOutbounds} = await buildWarpOutbounds(remoteDNS, localDNS, blockAds, bypassIran, blockPorn, bypassLAN, warpEndpoints) + const {xray: xrayWoWOutbounds, singbox: singboxWoWOutbounds} = await buildWoWOutbounds(remoteDNS, localDNS, blockAds, bypassIran, blockPorn, bypassLAN, wowEndpoint); + + singboxWarpConfig.outbounds[0].outbounds = ['ðĶ Warp Best Ping ð']; + singboxWarpConfig.outbounds[1].tag = 'ðĶ Warp Best Ping ð'; + xrayWarpConfig.dns = await buildDNSObject(remoteDNS, localDNS, blockAds, bypassIran, blockPorn); + xrayWarpConfig.routing.rules = buildRoutingRules(localDNS, blockAds, bypassIran, blockPorn, bypassLAN, false, false); + xrayWarpConfig.outbounds.splice(0,1); + xrayWarpConfig.routing.rules[xrayWarpConfig.routing.rules.length - 1].outboundTag = 'warp'; + delete xrayWarpConfig.observatory; + delete xrayWarpConfig.routing.balancers; + xrayWarpBestPing.remarks = 'ðĶ BPB - Warp Best Ping ð' + xrayWarpBestPing.dns = await buildDNSObject(remoteDNS, localDNS, blockAds, bypassIran, blockPorn); + xrayWarpBestPing.routing.rules = buildRoutingRules(localDNS, blockAds, bypassIran, blockPorn, bypassLAN, false, true); + xrayWarpBestPing.outbounds.splice(0,1); + xrayWarpBestPing.routing.balancers[0].selector = ['warp']; + xrayWarpBestPing.observatory.subjectSelector = ['warp']; + xrayWoWConfigTemp.dns = await buildDNSObject(remoteDNS, localDNS, blockAds, bypassIran, blockPorn); + xrayWoWConfigTemp.routing.rules = buildRoutingRules(localDNS, blockAds, bypassIran, blockPorn, bypassLAN, false, false); + xrayWoWConfigTemp.outbounds.splice(0,1); + delete xrayWoWConfigTemp.observatory; + delete xrayWoWConfigTemp.routing.balancers; + + xrayWarpOutbounds.forEach((outbound, index) => { + xrayWarpConfigs.push({ + ...xrayWarpConfig, + remarks: `ðĶ BPB - Warp ${index + 1} ðŪð·`, + outbounds: [{...outbound, tag: 'warp'}, ...xrayWarpConfig.outbounds] + }); + }); + + xrayWoWOutbounds.forEach((outbound, index) => { + if (outbound.tag.includes('warp-out')) { + let xrayWoWConfig = structuredClone(xrayWoWConfigTemp); + xrayWoWConfig.remarks = `ðĶ BPB - WoW ${index/2 + 1} ð`; + xrayWoWConfig.outbounds = [{...xrayWoWOutbounds[index]}, {...xrayWoWOutbounds[index + 1]}, ...xrayWoWConfig.outbounds]; + xrayWoWConfig.routing.rules[xrayWoWConfig.routing.rules.length - 1].outboundTag = outbound.tag; + xrayWarpConfigs.push(xrayWoWConfig); + } + }); - const { - remoteDNS, - localDNS, - blockAds, - bypassIran, - blockPorn, - bypassLAN, - warpEndpoint - } = proxySettings; + xrayWarpBestPing.outbounds = [...xrayWarpOutbounds, ...xrayWarpBestPing.outbounds]; + xrayWarpConfigs.push(xrayWarpBestPing); + + singboxWarpOutbounds.forEach((outbound, index) => { + singboxWarpConfig.outbounds.push(outbound); + singboxWarpConfig.outbounds[0].outbounds.push(outbound.tag); + singboxWarpConfig.outbounds[1].outbounds.push(outbound.tag); + if (domainRegex.test(outbound.server)) outboundDomains.push(outbound.server); + }); - let wowConfigXray = structuredClone(xrayConfigTemp); - let wowConfigSingbox = structuredClone(singboxConfigTemp); + singboxWoWOutbounds.forEach((outbound, index) => { + if (outbound.tag.includes('WoW')) { + singboxWarpConfig.outbounds.push(singboxWoWOutbounds[index], singboxWoWOutbounds[index + 1]); + singboxWarpConfig.outbounds[0].outbounds.push(outbound.tag); + if (domainRegex.test(outbound.server)) outboundDomains.push(outbound.server); + } + }); + + singboxWarpConfig.dns.rules[0].domain = [...new Set(outboundDomains)]; - for (let i = 0; i < 2; i++) { - let wgConfig = await fetchWgConfig(); - let xrayOutbound = structuredClone(xrayWgOutboundTemp); - let singboxOutbound = structuredClone(singboxWgOutboundTemp); - xrayOutbound.settings.address = [ - `${wgConfig.account.config.interface.addresses.v4}/32`, - `${wgConfig.account.config.interface.addresses.v6}/128` - ]; + return client === 'singbox' + ? singboxWarpConfig + : xrayWarpConfigs; +} - if (warpEndpoint) xrayOutbound.settings.peers[0].endpoint = warpEndpoint; - xrayOutbound.settings.peers[0].publicKey = wgConfig.account.config.peers[0].public_key; - xrayOutbound.settings.reserved = base64ToDecimal(wgConfig.account.config.client_id); - xrayOutbound.settings.secretKey = wgConfig.privateKey; - xrayOutbound.tag = i === 1 ? 'warp-ir' : 'warp-out'; - - if (i === 1) { - delete xrayOutbound.streamSettings; - } else { - xrayOutbound.streamSettings.sockopt.dialerProxy = 'warp-ir'; - } +const buildWarpOutbounds = async (remoteDNS, localDNS, blockAds, bypassIran, blockPorn, bypassLAN, warpEndpoints) => { + let wgConfig = await fetchWgConfig(); + let xrayOutboundTemp = structuredClone(xrayWgOutboundTemp); + let singboxOutbound = structuredClone(singboxWgOutboundTemp); + let xrayOutbounds = []; + let singboxOutbounds = []; + const ipv6Regex = /\[(.*?)\]/; + const portRegex = /[^:]*$/; + + xrayOutboundTemp.settings.address = [ + `${wgConfig.account.config.interface.addresses.v4}/32`, + `${wgConfig.account.config.interface.addresses.v6}/128` + ]; + + xrayOutboundTemp.settings.peers[0].publicKey = wgConfig.account.config.peers[0].public_key; + xrayOutboundTemp.settings.reserved = base64ToDecimal(wgConfig.account.config.client_id); + xrayOutboundTemp.settings.secretKey = wgConfig.privateKey; + delete xrayOutboundTemp.streamSettings; + + singboxOutbound.local_address = [ + `${wgConfig.account.config.interface.addresses.v4}/32`, + `${wgConfig.account.config.interface.addresses.v6}/128` + ]; + singboxOutbound.peer_public_key = wgConfig.account.config.peers[0].public_key; + singboxOutbound.reserved = wgConfig.account.config.client_id; + singboxOutbound.private_key = wgConfig.privateKey; + delete singboxOutbound.detour; + + warpEndpoints.split(',').forEach( (endpoint, index) => { + let xrayOutbound = structuredClone(xrayOutboundTemp); + xrayOutbound.settings.peers[0].endpoint = endpoint; + xrayOutbound.tag = `warp-${index + 1}`; xrayOutbounds.push(xrayOutbound); + + singboxOutbounds.push({ + ...singboxOutbound, + server: endpoint.includes('[') ? endpoint.match(ipv6Regex)[1] : endpoint.split(':')[0], + server_port: endpoint.includes('[') ? +endpoint.match(portRegex)[0] : +endpoint.split(':')[1], + tag: `ðĶ Warp ${index + 1} ðŪð·` + }); + }) + + return {xray: xrayOutbounds, singbox: singboxOutbounds}; +} - singboxOutbound.local_address = [ - `${wgConfig.account.config.interface.addresses.v4}/32`, - `${wgConfig.account.config.interface.addresses.v6}/128` - ]; +const buildWoWOutbounds = async (remoteDNS, localDNS, blockAds, bypassIran, blockPorn, bypassLAN, wowEndpoint) => { + let xrayOutbounds = []; + let singboxOutbounds = []; + const ipv6Regex = /\[(.*?)\]/; + const portRegex = /[^:]*$/; + const wgConfigs = [await fetchWgConfig(), await fetchWgConfig()]; - if (warpEndpoint) { - singboxOutbound.server = warpEndpoint.split(':')[0]; - singboxOutbound.server_port = +warpEndpoint.split(':')[1]; - } - singboxOutbound.peer_public_key = wgConfig.account.config.peers[0].public_key; - singboxOutbound.reserved = wgConfig.account.config.client_id; - singboxOutbound.private_key = wgConfig.privateKey; - singboxOutbound.tag = i === 1 ? 'ðĶ Warp' : 'ðĶ Warp on Warp ð'; + wowEndpoint.split(',').forEach( (endpoint, index) => { - if (i === 1) { - delete singboxOutbound.detour; - } else { - singboxOutbound.detour = 'ðĶ Warp'; + for (let i = 0; i < 2; i++) { + let xrayOutbound = structuredClone(xrayWgOutboundTemp); + let singboxOutbound = structuredClone(singboxWgOutboundTemp); + xrayOutbound.settings.address = [ + `${wgConfigs[i].account.config.interface.addresses.v4}/32`, + `${wgConfigs[i].account.config.interface.addresses.v6}/128` + ]; + + xrayOutbound.settings.peers[0].endpoint = endpoint; + xrayOutbound.settings.peers[0].publicKey = wgConfigs[i].account.config.peers[0].public_key; + xrayOutbound.settings.reserved = base64ToDecimal(wgConfigs[i].account.config.client_id); + xrayOutbound.settings.secretKey = wgConfigs[i].privateKey; + xrayOutbound.tag = i === 1 ? `warp-ir_${index + 1}` : `warp-out_${index + 1}`; + + if (i === 1) { + delete xrayOutbound.streamSettings; + } else { + xrayOutbound.streamSettings.sockopt.dialerProxy = `warp-ir_${index + 1}`; + } + + xrayOutbounds.push(xrayOutbound); + + singboxOutbound.local_address = [ + `${wgConfigs[i].account.config.interface.addresses.v4}/32`, + `${wgConfigs[i].account.config.interface.addresses.v6}/128` + ]; + + singboxOutbound.server = endpoint.includes('[') ? endpoint.match(ipv6Regex)[1] : endpoint.split(':')[0]; + singboxOutbound.server_port = endpoint.includes('[') ? +endpoint.match(portRegex)[0] : +endpoint.split(':')[1]; + singboxOutbound.peer_public_key = wgConfigs[i].account.config.peers[0].public_key; + singboxOutbound.reserved = wgConfigs[i].account.config.client_id; + singboxOutbound.private_key = wgConfigs[i].privateKey; + singboxOutbound.tag = i === 1 ? `warp-ir_${index + 1}` : `ðĶ WoW ${index + 1} ð`; + + if (i === 0) { + singboxOutbound.detour = `warp-ir_${index + 1}`; + } else { + delete singboxOutbound.detour; + } + + singboxOutbounds.push(singboxOutbound); } - singboxOutbounds.push(singboxOutbound); - } + }) - wowConfigXray.remarks = 'ðĶ BPB - Warp on Warp ð'; - wowConfigXray.dns = await buildDNSObject(remoteDNS, localDNS, blockAds, bypassIran, blockPorn); - wowConfigXray.routing.rules = buildRoutingRules(localDNS, blockAds, bypassIran, blockPorn, bypassLAN, false, false); - wowConfigXray.outbounds.splice(0,1); - delete wowConfigXray.observatory; - delete wowConfigXray.routing.balancers; - wowConfigXray.outbounds = [...xrayOutbounds, ...wowConfigXray.outbounds]; - wowConfigXray.routing.rules[wowConfigXray.routing.rules.length - 1].outboundTag = 'warp-out'; - let warpConfigXray = structuredClone(wowConfigXray); - warpConfigXray.outbounds.splice(0,1); - warpConfigXray.routing.rules[warpConfigXray.routing.rules.length - 1].outboundTag = 'warp-ir'; - warpConfigXray.remarks = 'ðĶ BPB - Warp'; - - wowConfigSingbox.dns.servers[0].address = remoteDNS; - wowConfigSingbox.dns.servers[1].address = localDNS; - wowConfigSingbox.dns.rules[0].domain = 'engage.cloudflareclient.com'; - wowConfigSingbox.outbounds.splice(1,1); - wowConfigSingbox.outbounds[0].outbounds = ['ðĶ Warp on Warp ð', 'ðĶ Warp']; - wowConfigSingbox.outbounds = [...wowConfigSingbox.outbounds, ...singboxOutbounds]; - delete wowConfigSingbox.route.final; - - return client === 'singbox' ? wowConfigSingbox : [{...wowConfigXray}, {...warpConfigXray}]; + return {xray: xrayOutbounds, singbox: singboxOutbounds}; } const fetchWgConfig = async () => { @@ -1389,12 +1487,12 @@ const buildDNSObject = async (remoteDNS, localDNS, blockAds, bypassIran, blockPo } if (blockAds) { - dnsObject.hosts["geosite:category-ads-all"] = "127.0.0.1"; - dnsObject.hosts["geosite:category-ads-ir"] = "127.0.0.1"; + dnsObject.hosts["geosite:category-ads-all"] = ["127.0.0.1"]; + dnsObject.hosts["geosite:category-ads-ir"] = ["127.0.0.1"]; } if (blockPorn) { - dnsObject.hosts["geosite:category-porn"] = "127.0.0.1"; + dnsObject.hosts["geosite:category-porn"] = ["127.0.0.1"]; } if (!bypassIran || localDNS === 'localhost' || isWorkerLess) { @@ -1487,25 +1585,36 @@ const base64ToDecimal = (base64) => { } const updateDataset = async (env, Settings) => { + let currentProxySettings = {}; + + try { + currentProxySettings = await env.bpb.get("proxySettings", {type: 'json'}); + } catch (error) { + console.log(error); + throw new Error(`An error occurred while getting current values - ${error}`); + } const vlessConfig = Settings?.get('outProxy'); + const proxySettings = { - remoteDNS: Settings?.get('remoteDNS') || 'https://94.140.14.14/dns-query', - localDNS: Settings?.get('localDNS') || '8.8.8.8', - lengthMin: Settings?.get('fragmentLengthMin') || '100', - lengthMax: Settings?.get('fragmentLengthMax') || '200', - intervalMin: Settings?.get('fragmentIntervalMin') || '5', - intervalMax: Settings?.get('fragmentIntervalMax') || '10', - blockAds: Settings?.get('block-ads') || false, - bypassIran: Settings?.get('bypass-iran') || false, - blockPorn: Settings?.get('block-porn') || false, - bypassLAN: Settings?.get('bypass-lan') || false, - cleanIPs: Settings?.get('cleanIPs')?.replaceAll(' ', '') || '', - proxyIP: Settings?.get('proxyIP') || '', - ports: Settings?.getAll('ports[]') || ['443'], - outProxy: vlessConfig || '', - outProxyParams: vlessConfig ? await extractVlessParams(vlessConfig) : '', - warpEndpoint: Settings?.get('endpoint') || 'engage.cloudflareclient.com:2408' + remoteDNS: Settings ? Settings.get('remoteDNS') : currentProxySettings?.remoteDNS || 'https://94.140.14.14/dns-query', + localDNS: Settings ? Settings.get('localDNS') : currentProxySettings?.localDNS || '8.8.8.8', + lengthMin: Settings ? Settings.get('fragmentLengthMin') : currentProxySettings?.lengthMin || '100', + lengthMax: Settings ? Settings.get('fragmentLengthMax') : currentProxySettings?.lengthMax || '200', + intervalMin: Settings ? Settings.get('fragmentIntervalMin') : currentProxySettings?.intervalMin || '5', + intervalMax: Settings ? Settings.get('fragmentIntervalMax') : currentProxySettings?.intervalMax || '10', + blockAds: Settings ? Settings.get('block-ads') : currentProxySettings?.blockAds || false, + bypassIran: Settings ? Settings.get('bypass-iran') : currentProxySettings?.bypassIran || false, + blockPorn: Settings ? Settings.get('block-porn') : currentProxySettings?.blockPorn || false, + bypassLAN: Settings ? Settings.get('bypass-lan') : currentProxySettings?.bypassLAN || false, + cleanIPs: Settings ? Settings.get('cleanIPs')?.replaceAll(' ', '') : currentProxySettings?.cleanIPs || '', + proxyIP: Settings ? Settings.get('proxyIP') : currentProxySettings?.proxyIP || '', + ports: Settings ? Settings.getAll('ports[]') : currentProxySettings?.ports || ['443'], + outProxy: Settings ? vlessConfig : currentProxySettings?.outProxy || '', + outProxyParams: vlessConfig ? await extractVlessParams(vlessConfig) : currentProxySettings?.outProxyParams || '', + wowEndpoint: Settings ? Settings.get('wowEndpoint')?.replaceAll(' ', '') : currentProxySettings?.wowEndpoint || 'engage.cloudflareclient.com:2408', + warpEndpoints: Settings ? Settings.get('warpEndpoints')?.replaceAll(' ', '') : currentProxySettings?.warpEndpoints || 'engage.cloudflareclient.com:2408', + panelVersion: panelVersion }; try { @@ -1629,21 +1738,22 @@ const renderHomePage = async (env, hostName, fragConfigs) => { } const { - remoteDNS = '', - localDNS = '', - lengthMin = '', - lengthMax = '', - intervalMin = '', - intervalMax = '', - blockAds = false, - bypassIran = false, - blockPorn = false, - bypassLAN = false, - cleanIPs = '', - proxyIP = '', - outProxy = '', - ports = ['443'], - warpEndpoint = 'engage.cloudflareclient.com:2408' + remoteDNS, + localDNS, + lengthMin, + lengthMax, + intervalMin, + intervalMax, + blockAds, + bypassIran, + blockPorn, + bypassLAN, + cleanIPs, + proxyIP, + outProxy, + ports, + wowEndpoint, + warpEndpoints } = proxySettings; const genCustomConfRow = async (configs) => { @@ -1680,7 +1790,7 @@ const renderHomePage = async (env, hostName, fragConfigs) => { let id = `port-${port}`; let portBlock = `