|
1221 | 1221 | try { |
1222 | 1222 | // 优先使用 Google DNS 查询 cloudflare-ech.com 的 ECH 配置 |
1223 | 1223 | debugSteps.push('尝试使用 Google DNS 查询 cloudflare-ech.com...'); |
1224 | | - const echDomainUrl = `https://dns.google/resolve?name=cloudflare-ech.com&type=65`; |
| 1224 | + const echDomainUrl = `https://v.recipes/dns/dns.google/dns-query?name=cloudflare-ech.com&type=65`; |
1225 | 1225 | const echResponse = await fetch(echDomainUrl, { |
1226 | 1226 | headers: { |
1227 | 1227 | 'Accept': 'application/json' |
|
1271 | 1271 |
|
1272 | 1272 | // 如果 cloudflare-ech.com 查询失败,尝试使用 Google DNS 查询目标域名的 HTTPS 记录 |
1273 | 1273 | debugSteps.push(`尝试使用 Google DNS 查询目标域名 ${domain}...`); |
1274 | | - const dohUrl = `https://dns.google/resolve?name=${encodeURIComponent(domain)}&type=65`; |
| 1274 | + const dohUrl = `https://v.recipes/dns/dns.google/dns-query?name=${encodeURIComponent(domain)}&type=65`; |
1275 | 1275 | const response = await fetch(dohUrl, { |
1276 | 1276 | headers: { |
1277 | 1277 | 'Accept': 'application/json' |
|
1598 | 1598 | // 如果启用了ECH且有ECH配置,添加ech参数(ECH需要伪装成Chrome浏览器) |
1599 | 1599 | if (enableECH && echConfig) { |
1600 | 1600 | wsParams.set('alpn', 'h3,h2,http/1.1'); |
1601 | | - wsParams.set('ech', echConfig); |
| 1601 | + wsParams.set('ech', `${workerDomain}+https://v.recipes/dns/dns.google/dns-query`); |
1602 | 1602 | } |
1603 | 1603 |
|
1604 | 1604 | links.push(`${proto}://${user}@${safeIP}:${port}?${wsParams.toString()}#${encodeURIComponent(wsNodeName)}`); |
|
1677 | 1677 | // 如果启用了ECH且有ECH配置,添加ech参数(ECH需要伪装成Chrome浏览器) |
1678 | 1678 | if (enableECH && echConfig) { |
1679 | 1679 | wsParams.set('alpn', 'h3,h2,http/1.1'); |
1680 | | - wsParams.set('ech', echConfig); |
| 1680 | + wsParams.set('ech', `${workerDomain}+https://v.recipes/dns/dns.google/dns-query`); |
1681 | 1681 | } |
1682 | 1682 |
|
1683 | 1683 | links.push(`${atob('dHJvamFuOi8v')}${password}@${safeIP}:${port}?${wsParams.toString()}#${encodeURIComponent(wsNodeName)}`); |
|
5302 | 5302 |
|
5303 | 5303 | // 如果启用了ECH且有ECH配置,添加ech参数(ECH需要伪装成Chrome浏览器) |
5304 | 5304 | if (enableECH && echConfig) { |
5305 | | - link += `&alpn=h3%2Ch2%2Chttp%2F1.1&ech=${encodeURIComponent(echConfig)}`; |
| 5305 | + link += `&alpn=h3%2Ch2%2Chttp%2F1.1&ech=${encodeURIComponent(`${workerDomain}+https://v.recipes/dns/dns.google/dns-query`)}`; |
5306 | 5306 | } |
5307 | 5307 |
|
5308 | 5308 | link += `#${encodeURIComponent(wsNodeName)}`; |
|
5321 | 5321 |
|
5322 | 5322 | // 如果启用了ECH且有ECH配置,添加ech参数(ECH需要伪装成Chrome浏览器) |
5323 | 5323 | if (enableECH && echConfig) { |
5324 | | - link += `&alpn=h3%2Ch2%2Chttp%2F1.1&ech=${encodeURIComponent(echConfig)}`; |
| 5324 | + link += `&alpn=h3%2Ch2%2Chttp%2F1.1&ech=${encodeURIComponent(`${workerDomain}+https://v.recipes/dns/dns.google/dns-query`)}`; |
5325 | 5325 | } |
5326 | 5326 |
|
5327 | 5327 | link += `#${encodeURIComponent(wsNodeName)}`; |
|
5358 | 5358 | // 如果启用了ECH且有ECH配置,添加ech参数(ECH需要伪装成Chrome浏览器) |
5359 | 5359 | if (enableECH && echConfig) { |
5360 | 5360 | params.set('alpn', 'h3,h2,http/1.1'); |
5361 | | - params.set('ech', echConfig); |
| 5361 | + params.set('ech', `${workerDomain}+https://v.recipes/dns/dns.google/dns-query`); |
5362 | 5362 | } |
5363 | 5363 |
|
5364 | 5364 | links.push(`vless://${user}@${safeIP}:${port}?${params.toString()}#${encodeURIComponent(wsNodeName)}`); |
|
5388 | 5388 |
|
5389 | 5389 | // 如果启用了ECH且有ECH配置,添加ech参数(ECH需要伪装成Chrome浏览器) |
5390 | 5390 | if (enableECH && echConfig) { |
5391 | | - link += `&alpn=h3%2Ch2%2Chttp%2F1.1&ech=${encodeURIComponent(echConfig)}`; |
| 5391 | + link += `&alpn=h3%2Ch2%2Chttp%2F1.1&ech=${encodeURIComponent(`${workerDomain}+https://v.recipes/dns/dns.google/dns-query`)}`; |
5392 | 5392 | } |
5393 | 5393 |
|
5394 | 5394 | link += `#${encodeURIComponent(wsNodeName)}`; |
|
5407 | 5407 |
|
5408 | 5408 | // 如果启用了ECH且有ECH配置,添加ech参数(ECH需要伪装成Chrome浏览器) |
5409 | 5409 | if (enableECH && echConfig) { |
5410 | | - link += `&alpn=h3%2Ch2%2Chttp%2F1.1&ech=${encodeURIComponent(echConfig)}`; |
| 5410 | + link += `&alpn=h3%2Ch2%2Chttp%2F1.1&ech=${encodeURIComponent(`${workerDomain}+https://v.recipes/dns/dns.google/dns-query`)}`; |
5411 | 5411 | } |
5412 | 5412 |
|
5413 | 5413 | link += `#${encodeURIComponent(wsNodeName)}`; |
|
0 commit comments