diff --git a/_worker.js b/_worker.js index a572217..413d028 100644 --- a/_worker.js +++ b/_worker.js @@ -14,7 +14,8 @@ export default { const uuidRegex = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/; const envUUID = env.UUID || env.uuid; const userID = (envUUID && uuidRegex.test(envUUID)) ? envUUID.toLowerCase() : [userIDMD5.slice(0, 8), userIDMD5.slice(8, 12), '4' + userIDMD5.slice(13, 16), '8' + userIDMD5.slice(17, 20), userIDMD5.slice(20)].join('-'); - const host = env.HOST ? env.HOST.toLowerCase().replace(/^https?:\/\//, '').split('/')[0].split(':')[0] : url.hostname; + const hosts = env.HOST ? (await 整理成数组(env.HOST)).map(h => h.toLowerCase().replace(/^https?:\/\//, '').split('/')[0].split(':')[0]) : [url.hostname]; + const host = hosts[0]; if (env.PROXYIP) { const proxyIPs = await 整理成数组(env.PROXYIP); 反代IP = proxyIPs[Math.floor(Math.random() * proxyIPs.length)];