Skip to content

Commit dd11c2a

Browse files
committed
fix: 修正节点HOST引用,确保使用正确的host变量
1 parent 6381c51 commit dd11c2a

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

_worker.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ export default {
260260
console.warn(`[订阅内容] 不规范的IP格式已忽略: ${原始地址}`);
261261
return null;
262262
}
263-
const 节点HOST = 随机替换通配符(config_JSON.HOST);
263+
const 节点HOST = 随机替换通配符(host);
264264
return `${协议类型}://${config_JSON.UUID}@${节点地址}:${节点端口}?security=tls&type=${config_JSON.传输协议}&host=${节点HOST}&sni=${节点HOST}&path=${encodeURIComponent((随机路径() + 节点路径).replace('/?', '?')) + TLS分片参数}&encryption=none${config_JSON.跳过证书验证 ? '&allowInsecure=1' : ''}#${encodeURIComponent(节点备注)}`;
265265
}).filter(item => item !== null).join('\n');
266266
订阅内容 = btoa(其他节点LINK + 订阅内容);
@@ -289,9 +289,9 @@ export default {
289289
}
290290
}
291291
if (订阅类型 === 'mixed') {
292-
订阅内容 = atob(订阅内容).replace(/example.com/g, 随机替换通配符(config_JSON.HOST)).replace(/00000000-0000-4000-0000-000000000000/g, config_JSON.UUID);
292+
订阅内容 = atob(订阅内容).replace(/example.com/g, config_JSON.HOST).replace(/00000000-0000-4000-0000-000000000000/g, config_JSON.UUID);
293293
if (!ua.includes('mozilla')) 订阅内容 = btoa(订阅内容);
294-
} else 订阅内容 = 订阅内容.replace(/example.com/g, 随机替换通配符(config_JSON.HOST)).replace(/00000000-0000-4000-0000-000000000000/g, config_JSON.UUID);
294+
} else 订阅内容 = 订阅内容.replace(/example.com/g, config_JSON.HOST).replace(/00000000-0000-4000-0000-000000000000/g, config_JSON.UUID);
295295
if (订阅类型 === 'singbox') {
296296
订阅内容 = JSON.stringify(JSON.parse(订阅内容), null, 2);
297297
responseHeaders["content-type"] = 'application/json; charset=utf-8';
@@ -829,7 +829,7 @@ function 随机替换通配符(h) {
829829
const 字符集 = 'abcdefghijklmnopqrstuvwxyz0123456789';
830830
return h.replace(/\*/g, () => {
831831
let s = '';
832-
for (let i = 0; i < Math.floor(Math.random() * 14) + 3; i++)
832+
for (let i = 0; i < Math.floor(Math.random() * 14) + 3; i++)
833833
s += 字符集[Math.floor(Math.random() * 36)];
834834
return s;
835835
});

0 commit comments

Comments
 (0)