mirror of
https://github.com/lush2020/edgetunnel.git
synced 2026-03-21 08:52:43 +08:00
fix: 更新HOST处理逻辑,支持多个主机并确保格式一致性
This commit is contained in:
@@ -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)];
|
||||
|
||||
Reference in New Issue
Block a user