fix: 更新ECH链接生成逻辑,使用cloudflare-ech.com前缀替代原有配置

This commit is contained in:
cmliu
2026-01-19 23:19:39 +08:00
parent 6fb9ab0720
commit 66c5e900e3
2 changed files with 5 additions and 4 deletions

View File

@@ -6,13 +6,15 @@
[![License](https://img.shields.io/github/license/cmliu/edgetunnel?style=flat-square)](https://github.com/cmliu/edgetunnel/blob/main/LICENSE)
[![Telegram](https://img.shields.io/badge/Telegram-Group-blue?style=flat-square&logo=telegram)](https://t.me/CMLiussss)
[![YouTube](https://img.shields.io/badge/YouTube-Channel-red?style=flat-square&logo=youtube)](https://www.youtube.com/watch?v=LeT4jQUh8ok)
[![DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/cmliu/edgetunnel)
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/cmliu/edgetunnel)
---
## 📖 项目简介
**edgetunnel** 是一个基于 CF Workers/Pages 平台的边缘计算隧道解密方案。它能够高效地处理网络流量,并提供强大的管理面板和灵活的节点配置能力。
- 🖥️ **Demo 演示站点**[https://EDT-Pages.github.io/admin](https://EDT-Pages.github.io/admin)
### ✨ 核心特性
- 🛡️ **协议支持**:支持 VLESS、Trojan 等主流协议,深度集成加密传输。
@@ -27,7 +29,6 @@
## 💡 快速部署
>[!TIP]
> 📖 **详尽图文教程**[edgetunnel 部署指南](https://cmliussss.com/p/edt2/)
> 🖥️ **Demo 演示站点**[https://EDT-Pages.github.io/admin](https://EDT-Pages.github.io/admin)
>[!WARNING]
> ⚠️ **Error 1101问题**[视频解析](https://www.youtube.com/watch?v=r4uVTEJptdE)

View File

@@ -280,7 +280,7 @@ export default {
return new Response('优选订阅生成器异常:' + error.message, { status: 403 });
}
}
const ECHLINK参数 = config_JSON.ECH ? `&ech=${encodeURIComponent(ECH_DOH)}` : '';
const ECHLINK参数 = config_JSON.ECH ? `&ech=${encodeURIComponent('cloudflare-ech.com+' + ECH_DOH)}` : '';
订阅内容 = 其他节点LINK + 完整优选IP.map(原始地址 => {
// 统一正则: 匹配 域名/IPv4/IPv6地址 + 可选端口 + 可选备注
// 示例:
@@ -1376,7 +1376,7 @@ async function 读取config_JSON(env, hostname, userID, path, 重置配置 = fal
if (!config_JSON.Fingerprint) config_JSON.Fingerprint = "chrome";
if (!config_JSON.ECH) config_JSON.ECH = false;
else config_JSON.优选订阅生成.SUBUpdateTime = 1; // 启用 ECH 时强制将订阅更新时间改为 1 小时
const ECHLINK参数 = config_JSON.ECH ? `&ech=${encodeURIComponent(ECH_DOH)}` : '';
const ECHLINK参数 = config_JSON.ECH ? `&ech=${encodeURIComponent('cloudflare-ech.com+' + ECH_DOH)}` : '';
config_JSON.LINK = `${config_JSON.协议类型}://${userID}@${host}:443?security=tls&type=${config_JSON.传输协议 + ECHLINK参数}&host=${host}&fp=${config_JSON.Fingerprint}&sni=${host}&path=${encodeURIComponent(config_JSON.启用0RTT ? config_JSON.PATH + '?ed=2560' : config_JSON.PATH) + TLS分片参数}&encryption=none${config_JSON.跳过证书验证 ? '&insecure=1&allowInsecure=1' : ''}#${encodeURIComponent(config_JSON.优选订阅生成.SUBNAME)}`;
config_JSON.优选订阅生成.TOKEN = await MD5MD5(hostname + userID);